malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   const long long INF32 = 1e9;   const long long INF64 = 1e17;   const int RANGE = 1e6 + 5;   using namespace std;   template <class T>   void read(T &Val) {     T tmp = 0;     char ch = getchar();     int flag = 1;     while (!(ch >=  0  && ch <=  9 )) {       if (ch ==  - ) flag = -1;       ch = getchar();     }     while ((ch >=  0  && ch <=  9 )) {       tmp = tmp * 10 + ch -  0 ;       ch = getchar();     }     Val = flag * tmp;   }   int q, cnt;   int n, m;   char data[300][300];   int bigX[] = {0, 1, -1, 0, 1, -1, 1, -1}, bigY[] = {1, 0, 0, -1, 1, -1, -1, 1};   void check(int x, int y) {     if (x < 0 or y < 0 or x >= m or y >= n or data[y][x] !=  1 ) return;     data[y][x] =  2 ;     cnt++;     for (int i = 0; i < 8; i++) check(x + bigX[i], y + bigY[i]);   }   int tell_square(int y, int x, int d) {     int yy = y + d, xx = x + d;     if (yy >= n or xx >= m) return 0;     for (int i = x; i <= xx; i++) {       if (data[y][i] !=  2  or data[yy][i] !=  2 ) return 0;     }     for (int i = y; i <= yy; i++) {       if (data[i][x] !=  2  or data[i][xx] !=  2 ) return 0;     }     return 1;   }   int tell_rombus(int y, int x, int d) {     int yy = y + d * 2, lxx = x - d, rxx = x + d;     if (yy >= n or rxx >= m or lxx < 0) return 0;     for (int i = 0; i <= d; i++) {       if (data[y + i][x + i] !=  2  or data[y + i + d][x + i - d] !=  2 ) {         return 0;       }     }     for (int i = 0; i <= d; i++) {       if (data[y + i][x - i] !=  2  or data[y + i + d][x - i + d] !=  2 ) {         return 0;       }     }     return 1;   }   int main() {     read(q);     while (q--) {       read(n), read(m);       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) cin >> data[i][j];       }       int ans = 0;       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           if (data[i][j] ==  0  or data[i][j] ==  2 ) continue;           cnt = 0;           check(j, i);           if ((cnt % 4) != 0 or cnt / 4 > 250) continue;           ans = ans + tell_rombus(i, j, cnt / 4) + tell_square(i, j, cnt / 4);         }       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     string s;     while (t--) {       cin >> s;       vector<int> E, O;       int io = 0, ie = 0, prev = -1;       for (int i = 0; i < s.size(); ++i) {         if ((s[i] - 48) % 2 == 0) {           if (io < O.size() && ie < E.size() && prev == 1) {             while (io < O.size() && ie < E.size()) {               if (O[io] < E[ie])                 cout << O[io++];               else                 cout << E[ie++];             }           }           E.push_back(s[i] - 48);           prev = 0;         } else {           if (io < O.size() && ie < E.size() && prev == 0) {             while (io < O.size() && ie < E.size()) {               if (O[io] < E[ie])                 cout << O[io++];               else                 cout << E[ie++];             }           }           O.push_back(s[i] - 48);           prev = 1;         }       }       if (io < O.size() && ie < E.size()) {         while (io < O.size() && ie < E.size()) {           if (O[io] < E[ie])             cout << O[io++];           else             cout << E[ie++];         }       }       while (io < O.size()) cout << O[io++];       while (ie < E.size()) cout << E[ie++];       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using uint = unsigned int;   using ll = long long;   using ull = unsigned long long;   using pii = pair<int, int>;   using pll = pair<ll, ll>;   template <typename T1, typename T2>   ostream &operator<<(ostream &out, const pair<T1, T2> &item) {     out <<  (  << item.first <<  ,   << item.second <<  ) ;     return out;   }   template <typename T>   ostream &operator<<(ostream &out, const vector<T> &v) {     for (const auto &item : v) out << item <<    ;     return out;   }   const double EPS = 1e-9;   int v[10];   int a[10][5];   vector<vector<int>> permutations;   double dist(const pair<pii, int> &a, const pair<pii, int> &b) {     return sqrt(1.0 * (a.first.first - b.first.first) *                     (a.first.first - b.first.first) +                 1.0 * (a.first.second - b.first.second) *                     (a.first.second - b.first.second) +                 1.0 * (a.second - b.second) * (a.second - b.second));   }   void check() {     vector<pair<pii, int>> b;     for (int i = 0; i < 8; ++i) {       const auto &p = permutations[v[i]];       b.push_back({{a[i][p[0]], a[i][p[1]]}, a[i][p[2]]});     }     for (int i = 0; i < 8; ++i)       for (int j = i + 1; j < 8; ++j)         if (b[i] == b[j]) return;     auto c1 = *min_element(b.begin(), b.end());     auto c2 = *max_element(b.begin(), b.end());     double aux = dist(c1, c2) / sqrt(3.0);     if (abs(aux - round(aux)) > EPS) return;     int d = round(aux);     vector<int> v1, v2;     for (int i = 0; i < 8; ++i) {       if (abs(dist(c1, b[i]) - d) < EPS) v1.push_back(i);       if (abs(dist(c2, b[i]) - d) < EPS) v2.push_back(i);     }     if (v1.size() != 3 || v2.size() != 3) return;     cout <<  YES n ;     for (int i = 0; i < 8; ++i)       cout << b[i].first.first <<     << b[i].first.second <<     << b[i].second            <<   n ;     exit(0);   }   void bkt(int k) {     if (k == 8) {       check();       return;     }     for (int i = 0; i < permutations.size(); ++i) {       v[k] = i;       bkt(k + 1);     }   }   int main() {     ios_base::sync_with_stdio(false);     vector<int> p = {0, 1, 2};     do {       permutations.push_back(p);     } while (next_permutation(p.begin(), p.end()));     for (int i = 0; i < 8; ++i)       for (int j = 0; j < 3; ++j) cin >> a[i][j];     bkt(1);     cout <<  NO n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 10;   int du[maxn];   set<int> g[maxn];   int b1[maxn], b2[maxn], ans[maxn], vis[maxn];   int main() {     int n, m, k;     scanf( %d%d%d , &n, &m, &k);     set<pair<int, int> > s;     for (int i = 0; i < m; i++) {       int x, y;       scanf( %d%d , &x, &y);       b1[i] = x, b2[i] = y;       du[x]++, du[y]++;       g[x].insert(y);       g[y].insert(x);     }     for (int i = 1; i <= n; i++) s.insert(make_pair(du[i], i));     for (int i = m - 1; i >= 0; i--) {       while (s.size() >= 1) {         pair<int, int> itt = (*s.begin());         if (itt.first >= k) break;         for (set<int>::iterator it = g[itt.second].begin();              it != g[itt.second].end(); it++) {           int u = *it;           if (vis[u] == 1) continue;           s.erase(make_pair(du[u], u));           du[u]--;           s.insert(make_pair(du[u], u));           g[u].erase(itt.second);         }         s.erase(itt);         vis[itt.second] = 1;       }       ans[i] = s.size();       if (vis[b1[i]] == 0 && vis[b2[i]] == 0) {         s.erase(make_pair(du[b1[i]], b1[i]));         du[b1[i]]--;         s.insert(make_pair(du[b1[i]], b1[i]));         g[b1[i]].erase(b2[i]);         s.erase(make_pair(du[b2[i]], b2[i]));         du[b2[i]]--;         s.insert(make_pair(du[b2[i]], b2[i]));         g[b2[i]].erase(b1[i]);       }     }     for (int i = 0; i < m; i++) printf( %d n , ans[i]);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t = 0;     cin >> t;     long long a = 0, b = 0;     for (int i = 0; i < t; i++) {       cin >> a >> b;       long long dif = abs(a - b);       long long res = dif / 5;       dif = dif % 5;       res += dif / 2;       dif %= 2;       res += dif;       cout << res << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int lala = 2e9 + 1;   int max(int a, int b) { return a > b ? a : b; }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n;     pair<int, int> arr[100005];     int dp[3][100005];     cin >> n;     for (int i = 0; i < n; i++) cin >> arr[i].first >> arr[i].second;     arr[n].first = lala, arr[n].second = 0;     dp[0][0] = 0;     dp[1][0] = 1;     dp[2][0] = arr[0].first + arr[0].second < arr[1].first ? 1 : 0;     for (int i = 1; i < n; i++) {       dp[0][i] = max(dp[0][i - 1], max(dp[1][i - 1], dp[2][i - 1]));       if (arr[i].first - arr[i].second > arr[i - 1].first) {         if (arr[i].first - arr[i].second > arr[i - 1].first + arr[i - 1].second) {           dp[1][i] = dp[0][i] + 1;         } else {           dp[1][i] = dp[1][i - 1] + 1;         }       } else {         dp[1][i] = dp[0][i];       }       if (arr[i].first + arr[i].second < arr[i + 1].first) {         dp[2][i] = dp[0][i] + 1;       } else {         dp[2][i] = dp[0][i];       }     }     cout << max(dp[0][n - 1], max(dp[1][n - 1], dp[2][n - 1])) << endl;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   double eps = 1e-10;   const int maxn = 30005;   char s[105][105];   int num[105][105], ans[105];   int main() {     ios::sync_with_stdio;     cin.tie(0);     double a, b, c, d;     cin >> a >> b >> c >> d;     double l = 0, r = 1e9 + 7;     for (int i = 1; i <= 100; i++) {       double mid = (l + r) / 2.0;       double maxia = max(max((a + mid) * (d + mid), (a + mid) * (d - mid)),                          max((a - mid) * (d + mid), (a - mid) * (d - mid)));       double minia = min(min((a + mid) * (d + mid), (a + mid) * (d - mid)),                          min((a - mid) * (d + mid), (a - mid) * (d - mid)));       double maxib = max(max((b + mid) * (c + mid), (b + mid) * (c - mid)),                          max((b - mid) * (c + mid), (b - mid) * (c - mid)));       double minib = min(min((b + mid) * (c + mid), (b + mid) * (c - mid)),                          min((b - mid) * (c + mid), (b - mid) * (c - mid)));       if (maxia >= minib && maxia <= maxib || minia >= minib && minia <= maxib ||           maxib >= minia && maxib <= maxia || minib >= minia && minib <= maxia)         r = mid;       else         l = mid;     }     printf( %.10lf n , l);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<long long, long long> mp[15];   long long k, a[200010];   int n, l[200010], r[200010];   long long ans = 0;   int itos(long long x) {     int now = 0;     while (x) {       now++;       x /= 10;     }     return now;   }   void add(int p) {     long long now = a[p];     for (int i = 1; i <= 10; i++) {       now *= 10;       now %= k;       mp[i][now]++;       if (i == l[p]) r[p] = now;     }   }   void sub(long long x) {     long long now = x;     for (int i = 1; i <= 10; i++) {       now *= 10;       now %= k;       mp[i][now]--;     }   }   int cal(int p) {     int anss = 0;     if (a[p] % k == 0)       anss = mp[l[p]][0] - (r[p] == 0);     else       anss = mp[l[p]][k - (a[p] % k)] - (r[p] == k - (a[p] % k));     return anss;   }   int main() {     cin.tie(0), cout.sync_with_stdio(false);     cin >> n >> k;     for (int i = 0; i < n; i++) {       cin >> a[i];       l[i] = itos(a[i]);       add(i);     }     for (int i = 0; i < n; i++) ans += cal(i);     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( unroll-loops ,  omit-frame-pointer ,  inline )   #pragma GCC option( arch=native ,  tune=native ,  no-zero-upper )   #pragma GCC target(         sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native )   #pragma GCC optimize( Ofast )   using namespace std;   const long double pi = acos(-1);   const long long int M = 1e9 + 7, N = 1e7 + 5, INF = 1e18;   void solve() {     long long int x, y, z, a, b, c, f1, f2, f3, f4, f5, f6, s = 0;     cin >> x >> y >> z >> a >> b >> c >> f1 >> f2 >> f3 >> f4 >> f5 >> f6;     if (y < 0) s += f1;     if (y > b) s += f2;     if (z > c) s += f4;     if (z < 0) s += f3;     if (x > a) s += f6;     if (x < 0) s += f5;     cout << s <<   n ;   }   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1000000007, MAX = 100003;   const long long INF = 1LL << 60;   int par[MAX];   long long mini[MAX], cost[MAX];   void init(int n) {     for (int i = 0; i < n; i++) {       par[i] = i;       mini[i] = cost[i];     }   }   int root(int a) {     if (par[a] == a)       return a;     else       return par[a] = root(par[a]);   }   void unite(int a, int b) {     if (root(a) != root(b)) {       mini[root(a)] = min(mini[root(a)], mini[root(b)]);       par[root(b)] = root(a);     }   }   bool check(int a, int b) { return root(a) == root(b); }   int main() {     int N, M;     cin >> N >> M;     for (int i = 0; i < N; i++) {       scanf( %lld , &cost[i]);     }     init(N);     for (int i = 0; i < M; i++) {       int a, b;       scanf( %d%d , &a, &b);       a--;       b--;       unite(a, b);     }     set<pair<int, int>> SE;     for (int i = 0; i < N; i++) {       SE.insert({root(i), mini[root(i)]});     }     long long ans = 0;     for (auto it = SE.begin(); it != SE.end(); it++) {       ans += (*it).second;     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int k, a[1001], i, j, poz, submisii_interesante, f[1001];   double ecran, fully_tested, n, timp = 1;   struct coada {     int x, y, z;   };   vector<coada> v;   int main() {     cin >> n >> k;     for (i = 1; i <= n; ++i) {       cin >> a[i];       if (k) {         v.push_back({0, a[i], i});         k--;         poz = i + 1;       }     }     while (!v.empty()) {       if (timp > 0 && double(timp) == int(timp)) {         for (size_t i = 0; i < v.size(); ++i) {           v[i].x++;           if (v[i].x == v[i].y) {             fully_tested++;             ecran = round((100 * fully_tested) / n);             v.erase(v.begin() + i, v.begin() + i + 1);             if (poz <= n) {               v.push_back({-1, a[poz], poz});               poz++;             }             i--;           }         }       }       if (double(timp - 0.5) == int(timp - 0.5)) {         for (size_t i = 0; i < v.size(); ++i) {           if (v[i].x + 1 == ecran && ecran) {             f[v[i].z]++;             if (f[v[i].z] == 1) {               submisii_interesante++;             }           }         }       }       timp = timp + 0.5;     }     cout << submisii_interesante;   }
#include <bits/stdc++.h>   using namespace std;   #pragma GCC target( avx2 )   #pragma GCC optimization( O3 )   #pragma GCC optimization( unroll-loops )   const int tam = 100010;   const int MOD = 1000000007;   const int MOD1 = 998244353;   const double DINF = 1e100;   const double EPS = 1e-9;   const double PI = acos(-1);   void solve() {     int n;     cin >> n;     vector<int> ar(n);     bool bo = true;     for (int i = 0; i < n; i++) {       cin >> ar[i];       bo &= ar[i] & 1 ^ i;     }     if (!bo) {       cout << -1 <<   n ;       return;     }     int a, b;     vector<int> res;     for (int i = n; i > 1; i -= 2) {       for (int j = 0; j < i; j++) {         if (ar[j] == i) a = j + 1;         if (ar[j] == i - 1) b = j + 1;       }       if (a == i && b == i - 1) {         continue;       }       if (a != 1) {         res.push_back(a);         reverse(ar.begin(), ar.begin() + a);         for (int j = 0; j < i; j++)           if (ar[j] == i - 1) b = j + 1;       }       if (b != 2) {         res.push_back(b - 1);         reverse(ar.begin(), ar.begin() + b - 1);         res.push_back(b + 1);         reverse(ar.begin(), ar.begin() + b + 1);         res.push_back(3);         reverse(ar.begin(), ar.begin() + 3);       }       res.push_back(i);       reverse(ar.begin(), ar.begin() + i);     }     cout << res.size() <<   n ;     for (int x : res) cout << x <<    ;     if (res.size()) cout <<   n ;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int mv = pow(10, 5) + 1;   void pfn() {     char x[mv], y[mv];     cin >> x >> y;     int ly = strlen(y) - 1, i;     i = ly;     while (i >= 0 && y[i] !=  1 ) i--;     int lx = strlen(x) - 1 - ly + i;     i = lx;     while (i >= 0 && x[i] !=  1 ) i--;     cout << lx - i <<   n ;   }   int main() {     int t;     cin >> t;     while (t--) pfn();   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   using namespace std;   long long int mod = 1000000007;   long long int maxn = 200001;   long long int binpow(long long int a, long long int b, long long int mod) {     long long int res = 1;     while (b > 0) {       if (b % 2) {         res = (res * a) % mod;         b--;       }       a = (a * a) % mod;       b /= 2;     }     return res % mod;   }   long long int binpow(long long int a, long long int b) {     long long int res = 1;     while (b > 0) {       if (b % 2) {         res = (res * a);         b--;       }       a = (a * a);       b /= 2;     }     return res;   }   bool isPrime(long long int n) {     if (n == 1) return false;     for (long long int i = 2; i * i <= n; i++) {       if (n % i == 0) return false;     }     return true;   }   long long int mulmod(long long int a, long long int b) {     return ((a % mod) * (b % mod)) % mod;   }   long long int addmod(long long int a, long long int b) {     return (((a % mod) + (b % mod)) + mod) % mod;   }   void solve();   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     long long int t = 2;     cin >> t;     for (long long int tt = 1; tt <= t; tt++) {       solve();     }   }   void solve() {     long long int n;     cin >> n;     string s1, s2;     cin >> s1 >> s2;     vector<long long int> oper;     bool zero;     if (s1[0] ==  0 )       zero = true;     else       zero = false;     for (long long int i = 0; i < n - 1; i++) {       if (s1[i] != s1[i + 1]) {         oper.push_back(i + 1);         zero = !zero;       }     }     if (!zero) oper.push_back(n);     s1 = string(n,  0 );     zero = true;     for (long long int i = n - 1; i >= 0; i--) {       if (s2[i] ==  1  and zero == true) {         oper.push_back(i + 1);         zero = false;       }       if (s2[i] ==  0  and zero == false) {         oper.push_back(i + 1);         zero = true;       }     }     cout << oper.size() <<    ;     for (long long int i = 0; i < oper.size(); i++) cout << oper[i] <<    ;     cout <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   struct node {     int wh, a, b, c, cst;     node(int WH, int A, int B, int C, int CST) {       wh = WH;       a = A;       b = B;       c = C;       cst = CST;     }     bool operator<(const node &t) const { return cst < t.cst; }   };   vector<node> v1, v2;   int main() {     int n;     cin >> n;     for (int i = 0; i < n; i++) {       int a, b, c, d;       cin >> a >> b >> c >> d;       v1.push_back(node(i + 1, a, b, c, d));     }     for (int i = 0; i < n; i++) {       bool b = true;       for (int j = 0; j < n; j++)         if (v1[i].a < v1[j].a && v1[i].b < v1[j].b && v1[i].c < v1[j].c)           b = false;       if (b) v2.push_back(v1[i]);     }     sort(v2.begin(), v2.end());     cout << v2[0].wh << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD(1000000009);   const int INF((1 << 30) - 1);   const int MAXN(100005);   int a[MAXN], na = 0;   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       int x;       scanf( %d , &x);       int low = 0, high = na - 1, mid, pos = na;       while (low <= high) {         mid = (low + high) / 2;         if (a[mid] > x)           pos = mid, high = mid - 1;         else           low = mid + 1;       }       a[pos] = x;       if (pos == na) na++;     }     printf( %d , na);   }
#include <bits/stdc++.h>   using namespace std;   long long v[100005];   long long st[400005];   void init(int idx, int a, int b) {     if (a == b) {       st[idx] = v[a];     } else {       int m = (a + b) / 2;       init(idx * 2 + 1, a, m);       init(idx * 2 + 2, m + 1, b);       st[idx] = max(st[idx * 2 + 1], st[idx * 2 + 2]);     }   }   long long query(int idx, int a, int b, int i, int j) {     if (i > b || j < a)       return -1;     else if (j >= b && i <= a)       return st[idx];     int m = (a + b) / 2;     long long x0 = query(idx * 2 + 1, a, m, i, j);     long long x1 = query(idx * 2 + 2, m + 1, b, i, j);     return max(x0, x1);   }   int main() {     int n;     int qry;     ios_base ::sync_with_stdio(0);     cin.tie(0);     char c;     int x, y;     cin >> n;     for (int i = 0; i < n; ++i) cin >> v[i];     init(0, 0, n - 1);     for (int i = 0; i < n; ++i) {       long long mn = query(0, 0, n - 1, i + 1, n - 1);       if (v[i] > mn)         cout << 0 <<    ;       else         cout << mn - v[i] + 1 <<    ;     }     cout <<   n ;   }
#include <bits/stdc++.h>   using namespace std;      int main() {       ios::sync_with_stdio(0);       int t;       cin >> t;       for (int tc=1; tc<=t; tc++) {           int n, x;           cin >> n >> x;           vector<int> v(n);           for (int i=0; i<n; i++) {               cin >> v[i];           }           vector<int> ans;           int sum = 0;           bool ok = true;           for (int i=0; i<n; i++) {               int val = v[i];               if (sum + val == x) {                   if (i == n-1) {                       ok = false;                       break;                   }                   swap(v[i], v[n-1]);                   val = v[i];               }               ans.push_back(val);               sum += val;           }           if (!ok) {               cout <<  NO n ;               continue;           }           cout <<  YES n ;           for (int i=0; i<n; i++) {               cout << ans[i] <<    n [i+1==n];           }       }   }
#include <bits/stdc++.h>   using namespace std;   int n, i, j, k, m;   char ss[111], c;   bool a[111];   string s[111], t;   bool eq(string a, string b) {     for (int i = 0; i < a.length(); i++)       if (a[i] <=  Z ) a[i] = a[i] -  A  +  a ;     for (int i = 0; i < b.length(); i++)       if (b[i] <=  Z ) b[i] = b[i] -  A  +  a ;     return a == b;   }   int main() {     scanf( %d , &n);     for (i = 0; i < n; i++) {       scanf( %s , ss);       s[i] = ss;     }     scanf( %s , ss);     t = ss;     m = t.length();     scanf( %s , ss);     c = ss[0];     for (i = 0; i < m; i++)       for (j = 0; j < n; j++)         if (i + s[j].length() <= m && eq(s[j], t.substr(i, s[j].length())))           for (k = 0; k < s[j].length(); k++) a[i + k] = true;     for (i = 0; i < m; i++)       if (a[i]) {         if (c ==  a ) {           if (t[i] == c)             t[i] =  b ;           else if (t[i] ==  A )             t[i] =  B ;           else if (t[i] <=  Z )             t[i] =  A ;           else             t[i] =  a ;         } else if (t[i] == c)           t[i] =  a ;         else if (t[i] == c -  a  +  A )           t[i] =  A ;         else if (t[i] <=  Z )           t[i] = c -  a  +  A ;         else           t[i] = c;       }     puts(t.c_str());     return 0;   }