int t; cin >> t; for (int k = 1; k <= t; k ++) { cout << "Case #" << k << ": ";
int kick = 0, ans = 0; string s; cin >> s; for (int i = 0; i < s.size() - 4; i ++) { if (s.substr(i, 4) == "KICK") kick++; if (s.substr(i, 5) == "START") ans += kick; }
signedmain() { ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); int t; cin >> t; for (int k = 1; k <= t; k ++) { cout << "Case #" << k << ": "; int m, n, p; cin >> m >> n >> p; for (int i = 1; i <= m; i ++) { for (int j = 1; j <= n; j ++) { cin >> a[i][j]; } } int ans = 0; for (int i = 1; i <= n; i ++) { int maxn = 0; for (int j = 1; j <= m; j ++) { maxn = max(maxn, a[j][i]); } ans += maxn - a[p][i]; } cout << ans << endl; } }