Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- int t;
- cin >> t;
- for(int i = 1; i <= t; i++){
- long n, k;
- cin >> n >> k;
- string s;
- cin >> s;
- int c = 0;
- for(int j = 0; j < n/2; j++){
- if(s[j] != s[n-j-1]){
- c++;
- }
- }
- cout << "Case #" << i << ": " << abs(c-k) << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement