func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int t, n;     string s;     cin >> t;     while (t--) {       cin >> n >> s;       vector<int> szs;       char prev = s.front();       int sz = 0;       for (char c : s) {         if (c != prev) {           szs.push_back(sz);           sz = 1;         } else           sz++;         prev = c;       }       szs.push_back(sz);       int cnt = 0, id = 1;       for (int i : szs) {         if (i > 1) cnt += min(i - 1, id - cnt);         id++;       }       cout << cnt + (szs.size() - cnt + 1) / 2 <<   n ;     }     return 0;   }   