40 lines
641 B
C++
40 lines
641 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <cmath>
|
|
|
|
using namespace std;
|
|
|
|
void run_case(int test_case){
|
|
int n, k;
|
|
string s;
|
|
|
|
cin >> n >> k;
|
|
cin >> s;
|
|
|
|
int result = 0;
|
|
|
|
auto ti = s.end() - 1;
|
|
int l = s.length();
|
|
for(auto it = s.begin(); it != s.begin() + l/2; ++it){
|
|
if((*it) != (*ti)){
|
|
result++;
|
|
}
|
|
--ti;
|
|
}
|
|
cout << "Case #" << test_case << ": " << abs(k - result) << endl;
|
|
}
|
|
|
|
|
|
|
|
int main(){
|
|
ios::sync_with_stdio(0);
|
|
cin.tie(0);
|
|
|
|
int t;
|
|
cin >> t;
|
|
|
|
for(int tc = 1; tc <= t; ++tc){
|
|
run_case(tc);
|
|
cout << flush;
|
|
}
|
|
} |