malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int MAX_N = 200005;   int l[MAX_N], r[MAX_N];   int a[MAX_N];   int n;   int F[MAX_N];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 1; i <= n; i++) {       l[i] = i;       while (a[l[i] - 1] >= a[i]) l[i] = l[l[i] - 1];     }     for (int i = n; i >= 1; i--) {       r[i] = i;       while (a[r[i] + 1] >= a[i]) r[i] = r[r[i] + 1];     }     for (int i = 1; i <= n; i++)       F[r[i] - l[i] + 1] = max(F[r[i] - l[i] + 1], a[i]);     for (int i = n; i >= 1; i--) F[i] = max(F[i], F[i + 1]);     for (int i = 1; i <= n; i++) printf( %d  , F[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int h;     long long n, l = 1, r, rpta = 0, aux2;     cin >> h >> n;     r = 1LL << h;     aux2 = r;     int aux = 1;     while (r > l) {       rpta++;       long long m = (l + r) / 2;       if (n <= m && aux == 0) {         rpta += aux2 - 1;       } else if (n > m && aux == 1) {         rpta += aux2 - 1;       } else         aux ^= 1;       if (n <= m)         r = m;       else         l = m + 1;       aux2 >>= 1;     }     cout << rpta << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MaxN = (int)1e3 + 10;   int a[MaxN][MaxN];   int main() {     int n, i, m, k, x, y, j;     char c;     scanf( %d%d%d n , &n, &m, &k);     for (i = 1; i <= n; i++)       for (j = 1; j <= m; j++) scanf( %d , &a[i][j]);     scanf(  n );     for (i = 1; i <= m; i++) a[0][i] = i;     for (i = 1; i <= n; i++) a[i][0] = i;     for (i = 1; i <= k; i++) {       scanf( %c , &c);       if (c ==  c ) {         scanf( %d%d n , &x, &y);         swap(a[0][x], a[0][y]);       }       if (c ==  r ) {         scanf( %d%d n , &x, &y);         swap(a[x][0], a[y][0]);       }       if (c ==  g ) {         scanf( %d%d n , &x, &y);         printf( %d n , a[a[x][0]][a[0][y]]);       }     }     cin.get();     cin.get();   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   const int M = 1e4 + 10;   const int MOD = 1e9 + 7;   const int inf = 1e9;   const double pi = acos(-1.0);   const double eps = 1e-6;   int dx[] = {0, -1, 0, 1};   int dy[] = {1, 0, -1, 0};   int n, m;   int a[101];   int sum[102];   int l, r;   int res;   int main() {     cin >> n >> m;     sum[0] = 0;     for (int i = 0; i < n; i++) {       cin >> a[i];       sum[i + 1] += sum[i] + a[i];     }     for (int i = 0; i < m; i++) {       cin >> l >> r;       int v = sum[r] - sum[l - 1];       if (v > 0) res += v;     }     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline void read(T& s) {     s = 0;     int f = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) f = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) {       s = s * 10 + c -  0 ;       c = getchar();     }     s *= f;   }   void exkmp(char* s, char* t, int n, int m, int* f, int* g) {     int mx = 0;     f[1] = n;     for (int i = 2; i <= m; i++) {       f[i] = max(0, min(mx + f[mx] - i, f[i - mx + 1]));       while (i + f[i] <= m && t[i + f[i]] == t[f[i] + 1]) f[i]++;       if (i + f[i] > mx + f[mx]) mx = i;     }     mx = 0;     for (int i = 1; i <= n; i++) {       g[i] = max(0, min(f[i - mx + 1], mx + g[mx] - i));       while (i + g[i] <= n && s[i + g[i]] == t[g[i] + 1]) g[i]++;       if (i + g[i] > mx + g[mx]) mx = i;     }   }   int n, m;   char a[1000005], b[1000005], at[1000005];   int f[1000005], g1[1000005], g2[1000005];   int mxw[1000005];   int main() {     n = m = 1;     char c = getchar();     while (c !=   n ) {       a[n++] = c;       c = getchar();     }     c = getchar();     while (c !=   n ) {       b[m++] = c;       c = getchar();     }     n--;     m--;     if (n != m) {       printf( -1 -1 n );       return 0;     }     if (a[1] != b[n]) {       printf( -1 -1 n );       return 0;     }     int mxi = 1;     for (mxi; mxi < n && a[mxi + 1] == b[n - mxi]; mxi++)       ;     for (int i = 1; i <= m; i++) at[i] = a[m + 1 - i];     exkmp(a, b, n, m, f, g1);     exkmp(b, at, n, m, f, g2);     memset(mxw, 23, sizeof(mxw));     for (int i = 1; i <= n; i++)       mxw[1 + n - g2[i] - i] = min(mxw[1 + n - g2[i] - i], i);     for (int i = 1; i <= n; i++) mxw[i] = min(mxw[i], mxw[i - 1]);     for (int i = mxi; i >= 1; i--) {       int mx = min(g1[i + 1] + 1, n - i);       int gg = mxw[i];       if (gg > mx) continue;       printf( %d %d n , i - 1, gg + i - 1);       return 0;     }     printf( -1 -1 n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T, typename U>   inline void smin(T &a, U b) {     if (a > b) a = b;   }   template <typename T, typename U>   inline void smax(T &a, U b) {     if (a < b) a = b;   }   int n, i, j, o, ans, cnt, num;   double a, b, c, d, first[1010], second[1010], p, q, r;   pair<pair<double, double>, double> m[1010 * 1010];   bool cmp(pair<pair<double, double>, double> a,            pair<pair<double, double>, double> b) {     if (fabs(a.first.first - b.first.first) > 1e-8)       return a.first.first < b.first.first;     if (fabs(a.first.second - b.first.second) > 1e-8)       return a.first.second < b.first.second;     return a.second < b.second;   }   int main() {     scanf( %d , &n);     for (i = 0; i < n; i++) {       scanf( %lf %lf %lf %lf , &a, &b, &c, &d);       p = a / b, q = c / d;       r = p * p + q * q;       first[i] = p / r, second[i] = q / r;     }     for (i = 0; i < n; i++) {       for (j = i + 1; j < n; j++) {         p = first[i] + first[j], q = second[i] + second[j];         m[o++] = pair<pair<double, double>, double>(             pair<double, double>(p, q),             fabs(first[i] - first[j]) < 1e-8                 ? 0x3f3f3f3f                 : (second[i] - second[j]) / (first[i] - first[j]));       }     }     sort(m, m + o, cmp);     for (i = 0; i < o; i = j) {       cnt = num = 1;       for (j = i + 1; j < o; j++) {         if (fabs(m[j].first.first - m[j - 1].first.first) > 1e-8) break;         if (fabs(m[j].first.second - m[j - 1].first.second) > 1e-8) break;         if (fabs(m[j].second - m[j - 1].second) > 1e-8) {           cnt = (long long)cnt * (num + 1) % 1000000007;           num = 1;         } else           num++;       }       cnt = (long long)cnt * (num + 1) % 1000000007;       ans = (ans + cnt) % 1000000007;       ans = (ans + 1000000007 - (j - i + 1)) % 1000000007;     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   int main() {     long n;     scanf( %ld , &n);     std::vector<long> a(n);     for (long p = 0; p < n; p++) {       scanf( %ld , &a[p]);     }     sort(a.begin(), a.end());     long cur(0);     for (long p = 0; p < n; p++) {       if (a[p] >= cur + 1) {         ++cur;       }     }     printf( %ld n , cur);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int q, w, e, r, t = 0, y = 0;     bool s[100001], d[100001];     char a[2];     cin >> q >> w;     for (e = 1; e <= q; e++) {       s[e] = 1;       d[e] = 0;     }     bool c = 1, v;     for (e = 0; e < w; e++) {       scanf( %s%d , a, &r);       if (a[0] ==  + ) {         if ((t == 0) || (t == r))           t = r;         else           s[r] = 0;         d[r] = 1;         if ((t != r) && (d[t] == 0)) s[t] = 0;         y++;       } else {         if (t == 0) t = r;         if ((t != r) && (d[r] == 0)) {           s[t] = 0;           t = r;         }         if (d[r]) {           d[r] = 0;           y--;         }         if (y > 0) s[r] = 0;       }     }     e = 0;     for (w = 1; w <= q; w++)       if (s[w]) e++;     cout << e <<   n ;     for (w = 1; w <= q; w++)       if (s[w]) printf( %d  , w);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long double eps = 1e-9;   const int inf = (1 << 30) - 1;   const long long inf64 = ((long long)1 << 62) - 1;   const long double pi = acos(-1);   template <class T>   T sqr(T x) {     return x * x;   }   template <class T>   T abs(T x) {     return x < 0 ? -x : x;   }   template <class T>   vector<T> ReadVector(int n) {     vector<T> a(n);     for (int i = 0; i < n; ++i) {       cin >> a[i];     }     return a;   }   template <class T>   void WriteVector(const vector<T>& a) {     for (int i = 0; i < ((int)(a).size()); ++i) {       cout << a[i] << (i + 1 < ((int)(a).size()) ?     :   n );     }   }   void Solve() {     long long x;     cin >> x;     vector<long long> a;     a.push_back(x);     vector<string> res;     while (a[0] != 1) {       long long val = -1;       for (int i = 0; i < ((int)(a).size()); ++i) {         for (int j = 0; j <= i; ++j) {           long long tmp = a[i] + a[j];           val = tmp;           for (int k = ((int)(a).size()) - 1; k >= 0; --k) {             tmp = min(tmp, tmp ^ a[k]);           }           if (tmp > 0) {             res.push_back(to_string(a[i]) +   +   + to_string(a[j]));             break;           }           val = -1;         }         if (val > 0) {           break;         }       }       for (int i = ((int)(a).size()) - 1; i >= 0; --i) {         if ((val ^ a[i]) < val) {           res.push_back(to_string(a[i]) +   ^   + to_string(val));           val ^= a[i];         }       }       for (int i = 0; i < ((int)(a).size()); ++i) {         if ((a[i] ^ val) < a[i]) {           res.push_back(to_string(a[i]) +   ^   + to_string(val));           a[i] ^= val;         }       }       a.push_back(val);       sort((a).begin(), (a).end());     }     cout << ((int)(res).size()) <<   n ;     for (int i = 0; i < ((int)(res).size()); ++i) {       cout << res[i] <<   n ;     }   }   int main() {     ios_base::sync_with_stdio(0);     std::cin.tie(nullptr);     int tc = 1;     for (int ti = 0; ti < tc; ++ti) {       Solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char ara[100005];   map<int, int> mp;   int main() {     int t, test;     long long a, b, c, n;     char ch;     double d;     gets(ara);     t = strlen(ara);     int aa = ara[t - 1] -  0 ;     int bb = ara[t - 2] -  0 ;     aa += (bb * 10);     if (aa % 4 == 0) {       cout <<  4 n ;     } else {       cout <<  0 n ;     }     return 0;   }
#include<cstdio>   #include<vector>   #include<map>   #include<set>   #include<algorithm>   #include<cstdlib>   #include<cstring>   #include<cmath>   #include<string>   #include<deque>   #include<queue>   using namespace std;   #define db double   #define ll long long   int T;   struct node{       ll x,y;   }p[10];   int u[10], u2[10]; ll x[10],y[10],s[10], u3[10];   ll ans;      void c1(ll px, ll py) {       ll now = 0;       now += abs(px - x[u2[1]]) + abs(py - y[u2[1]]);       now += abs(px - x[u2[3]]);       now += abs(py - y[u2[2]]);       s[1] = u3[1] * (x[u2[2]] - px);       s[2] = u3[2] * (y[u2[3]] - py);       s[3] = u3[3] * (x[u2[4]] - px);       s[4] = u3[4] * (y[u2[4]] - py);       sort(s+1, s+5);       for(int i=1; i<=4; i++) now+=abs(s[i] - s[2]);       // if (now==4){       //     printf( %lld %lld n , px, py);       //     for(int i=1; i<=4; i++) printf( %d  ,u2[i]);       //     printf(  n );       //     for(int i=1; i<=4; i++) printf( %lld %lld n , x[i], y[i]);       //     printf(  n );                  // }          ans = min(ans, now);   }      int main() {       scanf( %d ,&T);       for(;T--;) {           int n = 4;           ans = 0;           for(int i=1; i<=n; i++) {               scanf( %lld %lld ,&p[i].x, &p[i].y);               ans += p[i].x + p[i].y;               u[i] = i;           }                      for(;1;) {               for(int i=1; i<=n; i++)                   x[i] = p[u[i]].x, y[i] = p[u[i]].y;               for(int i=1; i<=n; i++) u2[i] = i, u3[i] = 1;               c1(x[1], y[1]); c1(x[1], y[2]); c1(x[3], y[1]); c1(x[3], y[2]);                u2[1] = 2; u2[2] = 1; u2[3] = 4; u2[4] = 3;               u3[1] = u3[3] = -1;               c1(x[2], y[1]); c1(x[2], y[2]); c1(x[4], y[1]); c1(x[4], y[2]);                  u2[1] = 3; u2[2] = 4; u2[3] = 1; u2[4] = 2;               u3[1] = 1; u3[2] = -1; u3[3] = 1; u3[4] = -1;               c1(x[1], y[3]); c1(x[1], y[4]); c1(x[3], y[3]); c1(x[3], y[4]);               u2[1] = 4; u2[2] = 3; u2[3] = 2; u2[4] = 1;               u3[1] = u3[3] = -1;               u3[2] = u3[4] = -1;               c1(x[2], y[3]); c1(x[2], y[4]); c1(x[4], y[3]); c1(x[4], y[4]);               if (!next_permutation(u+1, u+1+n)) break;           }                      printf( %lld n , ans);       }       return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int ans;   int a[2002], b[2002];   int le;   int p;   int ssearch(int x) {     int maxd = 0;     for (int i = 1; i <= n; i++) {       int z = abs(a[i] - b[x - le + i]) + abs(b[x - le + i] - p);       if (z > maxd) maxd = z;     }     return maxd;   }   int main() {     int k;     scanf( %d%d%d , &n, &k, &p);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);     }     for (int i = 1; i <= k; i++) {       scanf( %d , &b[i]);     }     sort(a + 1, a + 1 + n);     sort(b + 1, b + 1 + k);     le = n;     for (int i = 1; i <= n; i++)       if (a[i] >= p) {         le = i - 1;         break;       }     ans = 2147483647;     for (int i = le; i <= k + le - n; i++) {       int y = ssearch(i);       if (y < ans) ans = y;     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   #define ull unsigned long long   #define ll long long   #define il inline   #define db double   #define ls rt << 1   #define rs rt << 1 | 1   #define pb push_back   #define mp make_pair   #define pii pair<int, int>   #define X first   #define Y second   #define pcc pair<char, char>   #define vi vector<int>   #define vl vector<ll>   #define rep(i, x, y) for(int i = x; i <= y; i ++)   #define rrep(i, x, y) for(int i = x; i >= y; i --)   #define rep0(i, n) for(int i = 0; i < (n); i ++)   #define per0(i, n) for(int i = (n) - 1; i >= 0; i --)   #define ept 1e-9   #define sz(x) (x).size()   #define All(x) (x).begin(), (x).end()   using namespace std;   inline int read()   {    int x = 0, f = 1; char ch = getchar();    while (ch <  0  || ch >  9 ) { if (ch ==  - ) f = -1; ch = getchar(); }    while (ch >=  0  && ch <=  9 ) { x = x * 10 + ch -  0 ; ch = getchar(); }    return x * f;   }   inline ll read1()   {    ll x = 0, f = 1; char ch = getchar();    while (ch <  0  || ch >  9 ) { if (ch ==  - ) f = -1; ch = getchar(); }    while (ch >=  0  && ch <=  9 ) { x = x * 10 + ch -  0 ; ch = getchar(); }    return x * f;   }   #define int long long   const int N = 50010;   const int mod = 998244353;   int n, m;   int d[N][25];   void add(int &a, int b) {a += b; if (a >= mod) a -= mod;}   void dec(int &a, int b) {a -= b; if (a < 0) a += mod;}   int pow_mod(int a, int i)   {    int s = 1;    while (i)    {     if (i & 1) s = 1LL * s * a % mod;     a = 1LL * a * a % mod;     i >>= 1;    }    return s;   }   signed main()   {    n = read();    m = read();    rep0(i, n)     rep0(j, m)      d[j][i] = read();    rep0(i, m) sort(d[i], d[i] + n);    int ans = m;    int jc = 1;    rep(i, 1, n) jc = 1LL * jc * i % mod;    jc = pow_mod(jc, mod - 2);    rep0(i, m)    {     int res = 1;     rrep(j, n - 1, 0) res = 1LL * res * max(0LL, d[i][j] - (j + 1)) % mod;     dec(ans, 1LL * res * jc % mod);    }    printf( %d n , ans);    return 0;   }
#include <bits/stdc++.h>   using namespace std;   int count1(int x) {     int ans = 0;     while (x) {       ans += x & 1;       x >>= 1;     }     return ans;   }   int main() {     int n, p;     cin >> n >> p;     for (int x = 0; x * (p + 1) <= n; x++)       if (count1(n - x * p) <= x) {         cout << x;         return 0;       }     cout << -1;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using ii = pair<int, int>;   using vi = vector<int>;   using vll = vector<ll>;   using vii = vector<ii>;   const ll MOD = 998244353;   const ll INF = 1e18 + 9;   const int MAXN = 1000006;   const int MAXC = 20;   int n, arr[MAXN], num[MAXC];   ll dist[MAXC][MAXC], mem[1 << MAXC], realDist[1 << MAXC][MAXC];   ll solve(int p) {     if (mem[p] != -1) return mem[p];     mem[p] = INF;     for (int i = 0; i < MAXC; i++) {       if ((p & (1 << i)) == 0) {         mem[p] = min(mem[p], solve(p | (1 << i)) + realDist[p][i]);       }     }     return mem[p];   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     for (int i = 0; i < n; i++) {       cin >> arr[i];       arr[i]--;       for (int j = 0; j < MAXC; j++) {         dist[arr[i]][j] += num[j];       }       num[arr[i]]++;     }     int p = 0;     for (int i = 0; i < (1 << MAXC); i++) {       for (int j = 0; j < MAXC; j++) {         for (int k = 0; k < MAXC; k++) {           if (i & (1 << k)) realDist[i][j] += dist[k][j];         }       }     }     memset(mem, -1, sizeof(mem));     ll ans = INF;     mem[(1 << MAXC) - 1] = 0;     for (int i = 0; i < MAXC; i++) {       ans = min(ans, solve(p | (1 << i)));     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long a[3000], b[3000];   map<long long, pair<long long, long long> > mymap;   pair<long long, long long> p1, p2;   int main() {     std::ios::sync_with_stdio(false);     long long n, m, sa = 0, sb = 0;     p1.first = p1.second = p2.first = p2.second = -1;     mymap.clear();     cin >> n;     for (long long i = (long long)(1); i <= (long long)(n); i++) {       cin >> a[i];       sa += a[i];     }     cin >> m;     for (long long i = (long long)(1); i <= (long long)(m); i++) {       cin >> b[i];       sb += b[i];     }     long long curdiff = abs(sa - sb);     for (long long i = (long long)(1); i <= (long long)(n); i++) {       for (long long j = (long long)(1); j <= (long long)(m); j++) {         long long tmpsa, tmpsb;         tmpsa = sa - a[i] + b[j];         tmpsb = sb + a[i] - b[j];         if (abs(tmpsa - tmpsb) < curdiff) {           curdiff = abs(tmpsa - tmpsb);           p1.first = i;           p1.second = j;         }       }     }     for (long long i = (long long)(1); i <= (long long)(n - 1); i++) {       for (long long j = (long long)(i + 1); j <= (long long)(n); j++) {         long long val = a[i] + a[j];         val = val * 2ll;         mymap[val] = make_pair(i, j);       }     }     map<long long, pair<long long, long long> >::iterator it;     for (long long i = (long long)(1); i <= (long long)(m - 1); i++) {       for (long long j = (long long)(i + 1); j <= (long long)(m); j++) {         long long val = sa - sb + 2 * (b[i] + b[j]);         it = mymap.lower_bound(val);         if (it != mymap.begin()) it--;         if (it == mymap.end()) continue;         long long temp = val;         temp = abs(val - it->first);         if (temp < curdiff) {           curdiff = temp;           p1.first = (it->second).first;           p1.second = i;           p2.first = (it->second).second;           p2.second = j;         }         it++;         if (it != mymap.end()) {           temp = abs(val - it->first);           if (temp < curdiff) {             curdiff = temp;             p1.first = (it->second).first;             p1.second = i;             p2.first = (it->second).second;             p2.second = j;           }         }       }     }     cout << curdiff << endl;     if (p2.first != -1) {       cout <<  2  << endl;       cout << p1.first <<     << p1.second << endl;       cout << p2.first <<     << p2.second << endl;     } else if (p1.first != -1) {       cout <<  1  << endl;       cout << p1.first <<     << p1.second << endl;     } else {       cout <<  0  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     scanf( %d , &t);     while (t--) {       int n;       scanf( %d , &n);       vector<int> vt;       while (n) {         int lst = -1;         for (int i = 2;; i++) {           if (1ll * i * (i - 1) / 2 <= n)             lst = i;           else             break;         }         vt.push_back(lst);         n -= 1ll * lst * (lst - 1) / 2;       }       int maxi = vt[0];       reverse(vt.begin(), vt.end());       printf( 1 );       int x = 0, sum = 0;       for (int i = 1; i <= maxi; i++) {         printf( 3 );         while (x < vt.size() && i == vt[x]) {           printf( 7 );           x++;         }       }       printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2000 + 50;   int n, cnt[maxn], a[maxn];   vector<int> q;   int main() {     cin >> n;     int sign = 0;     for (int i = 1; i < n; i++) {       int x, y;       cin >> x >> y;       if (x > y) swap(x, y);       if (y != n) sign = 1;       cnt[x]++;       a[i] = x;     }     sort(a + 1, a + n);     for (int i = 1; i < n; i++) {       if (a[i] < i) {         sign = 1;       }     }     if (sign) {       cout <<  NO  << endl;       return 0;     }     cout <<  YES  << endl;     for (int i = 1; i < n; i++) {       if (cnt[i]) {         q.push_back(i);       }     }     int opt = 1;     for (int x = 0; x < q.size(); x++) {       int pre = n;       for (int i = 1; i <= cnt[q[x]] - 1; i++) {         while (cnt[opt]) opt++;         cout << pre <<     << opt << endl;         pre = opt;         opt++;       }       cout << pre <<     << q[x] << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int mxn = 0;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int t = 1;     cin >> t;     while (t--) {       long long int i, j, k, n, m;       string s;       cin >> s;       n = s.length();       string a, b, c;       i = -1;       j = n;       while ((i + 1) < (j - 1) && s[i + 1] == s[j - 1]) {         a += s[i + 1];         i++, j--;       }       c = a;       reverse(c.begin(), c.end());       long long int pr = -1, sf = -1;       for (long long int i1 = i + 1; i1 < j; i1++) {         long long int st = i + 1, en = i1;         while (st <= en && s[st] == s[en]) st++, en--;         if (st > en) pr = i1;       }       for (long long int i1 = i + 1; i1 < j; i1++) {         long long int st = i1, en = j - 1;         while (st <= en && s[st] == s[en]) st++, en--;         if (st > en) {           sf = i1;           break;         }       }       if (pr != -1) {         if (pr - i > j - sf) {           for (long long int i1 = i + 1; i1 <= pr; i1++) b += s[i1];         } else {           for (long long int i1 = sf; i1 < j; i1++) b += s[i1];         }       }       cout << a << b << c <<   n ;     }     return 0;   }