malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 4002;   int n = 0, a;   char ch[N];   long long ans = 0, sum[N][N], all;   long long d[N * 9];   int val(int ind) { return ch[ind - 1] -  0 ; }   int main() {     cin >> a;     while (cin >> ch[n]) n++;     for (int i = 1; i <= n; ++i) {       for (int j = i; j <= n; ++j) {         sum[i][j] = val(j) + sum[1][j - 1] - sum[1][i - 1];         d[sum[i][j]]++;       }     }     for (int tt = 0; tt <= 4000 * 9; ++tt) all += d[tt];     for (int i = 1; i <= n; ++i) {       for (int j = i; j <= n; ++j) {         if (sum[i][j] == 0) {           if (a == 0) ans += all;           continue;         }         int cur = a / sum[i][j];         if (cur * sum[i][j] == a) {           if (cur >= 0 && cur <= 4000 * 9) ans += d[cur];         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int md = 998244853;   long long ans, f[4005][4005], x, y, n, m;   int main() {     cin >> n >> m;     for (int i = 0; i <= n + m; i++) f[i][0] = f[i][i] = 1;     for (int i = 0; i <= n + m; i++)       for (int j = 0; j < i; j++)         f[i][j] = (f[i - 1][j - 1] % md + f[i - 1][j] % md) % md;     for (int i = n; i && i >= n - m; i--) {       x = (f[n + m][n - i] - y + md) % md;       (ans += (x * i) % md) %= md;       (y += x) %= md;     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long dp[1050000], k[25][25], a[1050000];   int main() {     long long n, m;     while (scanf( %lld%lld , &n, &m) == 2) {       string s;       cin >> s;       memset(k, 0, sizeof(k));       for (int i = 1; i < s.length(); i++) {         k[s[i - 1] -  a ][s[i] -  a ]++;         k[s[i] -  a ][s[i - 1] -  a ]++;       }       long long an = (1 << m) - 1;       dp[0] = a[0] = 0;       for (int i = 1; i <= an; i++) {         dp[i] = 1e17 + 5;         a[i] = 0;         for (int f = 0; f < m; f++) {           if (i & (1 << f)) {             dp[i] = min(dp[i], dp[i ^ (1 << f)] + a[i ^ (1 << f)]);           }         }         for (int f = 0; f < m; f++) {           for (int j = f + 1; j < m; j++) {             if (((i >> f) & 1) ^ ((i >> j) & 1)) {               a[i] += k[f][j];             }           }         }       }       printf( %lld n , dp[an]);     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long a;     cin >> a;     vector<long long> x;     for (long long i = 0; i < a; i++) {       long long b;       cin >> b;       x.push_back(b);     }     bool done[101] = {false};     sort(x.begin(), x.end());     long long counter = 0;     long long ans = 0;     while (counter != a) {       long long num = 0;       for (long long i = 0; i < a; i++) {         if (x[i] >= num && !done[i]) {           num++;           counter++;           done[i] = true;         }       }       ans++;     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int ar[100001], csum[100001];   int main() {     ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);     int n, q;     cin >> n;     for (int i = 0; i < n; i++) cin >> ar[i];     for (int i = 1; i <= n; i++) {       csum[i] = csum[i - 1] + ar[i - 1];     }     cin >> q;     while (q--) {       int l, r;       cin >> l >> r;       cout << (csum[r] - csum[l - 1]) / 10 <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 7;   long long a[N], b[N];   deque<int> mx, mn;   int main() {     long long n;     cin >> n;     long long i;     for (i = 1; i <= n; i++) cin >> a[i];     for (i = 1; i <= n; i++) cin >> b[i];     long long j, ans = 0;     for (j = 1, i = 1; i <= n; i++) {       while (!mx.empty() and a[mx.back()] <= a[i]) mx.pop_back();       while (!mn.empty() and b[mn.back()] >= b[i]) mn.pop_back();       mx.push_back(i), mn.push_back(i);       while (j <= i and a[mx.front()] - b[mn.front()] > 0) {         j++;         while (!mx.empty() and mx.front() < j) mx.pop_front();         while (!mn.empty() and mn.front() < j) mn.pop_front();       }       if (!mx.empty() and !mn.empty() and a[mx.front()] == b[mn.front()])         ans += min(mx.front(), mn.front()) - j + 1;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   const double eps = 1e-8;   const int mod = 8 * 9 * 7 * 11 * 13 * 5;   const int maxn = 205;   const double pi = acos(-1.0);   const int INF = 0x7f7f7f7f;   const double inf = 1e50;   template <class T>   inline T minx(T a, T b) {     return (a == -1 || b < a) ? b : a;   }   template <class T>   inline T gcd(T a, T b) {     return b ? gcd(b, a % b) : a;   }   template <class T>   inline T lcm(T a, T b) {     return a * (b / gcd(a, b));   }   template <class T>   inline T getbit(T n) {     return n ? (1 + getbit(n & (n - 1))) : 0;   }   template <class T>   inline T lowbit(T n) {     return n & (-n);   }   using namespace std;   long long dp[mod + 2];   long long a, b, k, c, y = 0, l, i, t;   int main() {     cin >> a >> b >> k;     while (a > b) {       l = 1;       for (i = 2; i <= k; i++) {         t = a % i;         if ((t > l) && (a - t) >= b) l = t;       }       y++, a -= l;       if (dp[a % mod]) {         c = y - dp[a % mod];         y += c * ((a - b) / mod);         a -= ((a - b) / mod) * mod;       }       dp[a % mod] = y;     }     cout << y << endl;     return 0;   }
#include <bits/stdc++.h>   #pragma warning(disable : 4786)   #pragma warning(disable : 4996)   using namespace std;   int c[200005], d[200005];   int main() {     int n;     scanf( %d , &n);     int val = 0;     int lb, ub;     lb = -1000000000;     ub = 1000000000;     for (int i = 1; i <= n; i++) {       scanf( %d %d , &c[i], &d[i]);       if (d[i] == 1) {         lb = ((lb) > (1900 - val) ? (lb) : (1900 - val));       } else {         ub = ((ub) < (1899 - val) ? (ub) : (1899 - val));       }       val += c[i];     }     if (lb > ub) {       printf( Impossible n );       return 0;     }     val = ub;     for (int i = 1; i <= n; i++) {       val += c[i];     }     if (val >= 100000000)       printf( Infinity n );     else       printf( %d n , val);     return 0;   }
#include <bits/stdc++.h>   int main() {     char a[1000005];     scanf( %s , a);     int i;     long long ans = 0, b = 0;     for (i = strlen(a) - 1; i >= 0; i--) {       if (a[i] ==  b )         b++;       else if (a[i] ==  a ) {         ans += b;         b <<= 1;       }       ans %= 1000000007;       b %= 1000000007;     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, m, k, ans, cnt;   char c[333][333];   pair<int, pair<int, int> > p[3 * int(1e5)];   int main() {     cin >> n >> m >> k;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         cin >> c[i][j];       }     }     for (int q = 1; q <= min(n, m); q++) {       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           if (c[i][j] ==  * )             if (i + q <= n && i - q > 0 && j + q <= m && j - q > 0) {               if (c[i + q][j] ==  *  && c[i - q][j] ==  *  &&                   c[i][j + q] ==  *  && c[i][j - q] ==  * )                 ans++;               if (ans == k) {                 cout << i <<     << j << endl                      << i - q <<     << j << endl                      << i + q <<     << j << endl                      << i <<     << j - q << endl                      << i <<     << j + q;                 return 0;               }             }         }       }     }     cout << -1;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, a[100100], a1[100100], a2[100100];   int main() {     while (scanf( %d , &n) != -1) {       int ans1 = -1, ans2 = -1;       for (int i = 0; i < n; i++) scanf( %d , a + i);       for (int i = 0; i < n - 1; i++) scanf( %d , a1 + i);       for (int i = 0; i < n - 2; i++) scanf( %d , a2 + i);       map<int, int> mp;       for (int i = 0; i < n - 1; i++) mp[a1[i]]++;       for (int i = 0; i < n; i++) {         if (mp[a[i]]-- <= 0) {           ans1 = a[i];         }       }       mp.clear();       for (int i = 0; i < n - 2; i++) mp[a2[i]]++;       for (int i = 0; i < n - 1; i++) {         if (mp[a1[i]]-- <= 0) {           ans2 = a1[i];         }       }       printf( %d n%d n , ans1, ans2);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string ff, ll;     cin >> ff >> ll;     string ans =   ;     ans += ff[0];     for (int i = 1; i < ff.length(); i++) {       if (ff[i] >= ll[0]) {         ans += ll[0];         break;       }       ans += ff[i];       if (i == ff.length() - 1) {         ans += ll[0];       }     }     if (ff.length() == 1) ans += ll[0];     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n;     cin >> n;     vector<int> a(n);     int psum = 0, msum = 0;     int zero = 0;     for (int i = 0; i < n; i++) {       cin >> a[i];       if (a[i] > 0) psum += a[i];       if (a[i] < 0) msum += a[i];     }     if (psum > abs(msum)) {       puts( YES );       sort(a.begin(), a.end(), greater<int>());       for (int i = 0; i < n; i++) {         cout << a[i] <<    ;       }       cout <<   n ;     } else if (psum < abs(msum)) {       puts( YES );       sort(a.begin(), a.end());       for (int i = 0; i < n; i++) {         cout << a[i] <<    ;       }       cout <<   n ;     } else       puts( NO );   }   int main() {     int tc;     cin >> tc;     while (tc--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, p;     scanf( %d %d , &n, &p);     int nums[n];     int sum = 0;     for (int i = 0; i < n; i++) {       cin >> nums[i];       nums[i] %= p;       sum += nums[i];       sum %= p;     }     int max_part = 0;     int left = 0;     int right = sum;     for (int i = 0; i < n; i++) {       left += nums[i];       left %= p;       right -= nums[i];       while (right < 0) {         right += p;       }       int part = left + right;       if (part > max_part) {         max_part = part;       }     }     cout << max_part;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 998244353;   const long long N = 2e5 + 1;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long n;     cin >> n;     vector<long long> nums(n);     for (long long i = 0; i < n; i++) {       long long k;       cin >> k;       nums[i] = abs(k);     }     sort(nums.begin(), nums.end());     long long ans = 0;     for (long long i = 0; i < n; i++) {       long long cur = nums[i];       long long ub = cur * 2;       if (ub == 0) {         continue;       }       long long low = i + 1;       long long high = n - 1;       long long pos = -1;       while (low <= high) {         long long mid = low + (high - low) / 2;         if (nums[mid] <= ub) {           pos = mid;           low = mid + 1;         } else {           high = mid - 1;         }       }       if (pos != -1) {         ans += (pos - i);       }     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   class point {    public:     int x, y;     point(int _x, int _y) {       x = _x;       y = _y;     }     string str() {       stringstream ss;       ss <<  (  << x <<  ,   << y <<  ) ;       return ss.str();     }   };   int main() {     int n;     cin >> n;     point min = point(31400, 31400), max = point(0, 0);     int used_area = 0;     for (int i = 0; i < n; i++) {       int x1, y1, x2, y2;       cin >> x1 >> y1 >> x2 >> y2;       point p1 = point(x1, y1), p2 = point(x2, y2);       if (x1 < min.x) min.x = x1;       if (y1 < min.y) min.y = y1;       if (x2 > max.x) max.x = x2;       if (y2 > max.y) max.y = y2;       used_area += (x2 - x1) * (y2 - y1);     }     int total_area = (max.x - min.x) * (max.y - min.y);     if (used_area == total_area && (max.x - min.x) == (max.y - min.y))       cout <<  YES  << endl;     else       cout <<  NO  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int mod = 1000000000 + 7;   const long long int N = 10000000 + 6;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n, m, k;     cin >> n >> m >> k;     int ind[k + 1];     int arr[k];     for (int i = 0; i < k; i++) {       cin >> arr[i];       ind[arr[i]] = i + 1;     }     long long int ans = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         int v;         cin >> v;         ans = ans + ind[v];         int temp = ind[v];         for (int l = 1; l <= k; l++) {           if (ind[l] < temp) ind[l]++;         }         ind[v] = 1;       }     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<int> graf[300007];   struct zap {     long long zmiana;     long long gle;   };   vector<zap> z[300007];   int ojc[300007];   long long liczba[300007];   map<long long, long long> zmiany;   void licz(int poz, int pop, long long zmiana, long long gl) {     for (int i = 0; i < z[poz].size(); i++) {       zmiana += z[poz][i].zmiana;       zmiany[gl + z[poz][i].gle] += z[poz][i].zmiana;     }     liczba[poz] = zmiana;     zmiana -= zmiany[gl];     for (int i = 0; i < graf[poz].size(); i++) {       if (graf[poz][i] != pop) {         licz(graf[poz][i], poz, zmiana, gl + 1);       }     }     for (int i = 0; i < z[poz].size(); i++) {       zmiany[gl + z[poz][i].gle] -= z[poz][i].zmiana;     }   }   int main() {     ios_base::sync_with_stdio(0);     int n, m;     cin >> n;     int a, b;     for (int i = 1; i < n; i++) {       cin >> a >> b;       graf[a].push_back(b);       graf[b].push_back(a);     }     cin >> m;     for (int i = 0; i < m; i++) {       cin >> a;       long long dl, ile;       cin >> dl >> ile;       zap x;       x.zmiana = ile;       x.gle = dl;       z[a].push_back(x);     }     licz(1, -1, 0, 0);     for (int i = 1; i <= n; i++) cout << liczba[i] <<    ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     string s[1000];     scanf( %d , &n);     for (int i = 0; i < n; i++) {       cin >> s[i];     }     char ch = s[0][0];     int flg = 0, cnc = 0, cnch = 0;     char c = s[0][1];     if (c == ch) flg = 1;     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         if (s[i][j] == c) {           cnc++;         } else if (s[i][j] == ch) {           cnch++;         } else           flg = 1;       }     }     if (cnch != 2 * n - 1)       flg = 1;     else if (n * n - cnch != cnc)       flg = 1;     for (int j = 0, i = 0; i < n / 2; i++) {       if (s[i][i] == s[i][n - i - 1] && ch == s[i][i]) {       } else         flg = 1;     }     if (s[n / 2][n / 2] != ch) flg = 1;     for (int j = 0, i = n - 1; i > n / 2; j++, i--) {       if (s[i][j] == s[i][n - 1 - j] && ch == s[i][j]) {       } else         flg = 1;     }     if (flg)       cout <<  NO  << endl;     else       cout <<  YES  << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long t = 1, tt;   void solve() {     long long n;     cin >> n;     string a, b;     cin >> a >> b;     if (n == 1) {       if (a == b)         cout << 0;       else         cout << 1;       return;     }     long long ans = 0;     for (long long i = 0; i < n / 2; i += 1) {       set<char> ss;       map<char, long long> mapa;       ss.insert(a[i]);       mapa[a[i]]++;       ss.insert(a[n - i - 1]);       mapa[a[n - i - 1]]++;       ss.insert(b[i]);       mapa[b[i]]++;       ss.insert(b[n - i - 1]);       mapa[b[n - i - 1]]++;       if (int((ss).size()) == 4) ans += 2;       if (int((ss).size()) == 3) {         if (a[i] == a[n - i - 1])           ans += 2;         else           ans += 1;       }       if (int((ss).size()) == 2) {         if (mapa[a[i]] == 1 || mapa[a[i]] == 3) ans += 1;       }     }     if (n % 2 == 1) {       if (a[n / 2] != b[n / 2]) ans += 1;     }     cout << ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     tt = t;     while (t--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline int gi() {     int data = 0, fu = 1;     char ch = 0;     while (ch !=  -  && (ch <  0  || ch >  9 )) ch = getchar();     if (ch ==  - ) fu = -1, ch = getchar();     while ( 0  <= ch && ch <=  9 )       data = (data << 1) + (data << 3) + (ch ^ 48), ch = getchar();     return data * fu;   }   int n, nq, q[200005];   map<long long, long long> M;   struct Node {     long long x, y;   } p[200005];   const long double eps = 1e-8;   inline long double Slope(int i, int j) {     return (long double)(p[i].y - p[j].y) / (long double)(p[i].x - p[j].x);   }   inline bool cmp(Node a, Node b) { return a.x ^ b.x ? a.x < b.x : a.y < b.y; }   int main() {     n = gi();     for (long long i = 1, x, y; i <= n; ++i) {       x = gi(), y = gi();       y -= x * x;       if (M.find(x) == M.end()) M[x] = -1e18;       M[x] = max(M[x], y);     }     n = 0;     for (map<long long, long long>::iterator it = M.begin(); it != M.end();          it++) {       long long X = it->first, Y = it->second;       long long i;       p[i = ++n].x = X, p[i].y = Y;     }     sort(p + 1, p + n + 1, cmp);     nq = 0;     for (long long i = 1; i <= n; ++i) {       while (nq >= 2 &&              Slope(q[nq - 1], q[nq]) - eps <= Slope(q[nq - 1], i) + eps)         --nq;       q[++nq] = i;     }     cout << nq - 1 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 1e+6 + 5;   long long big = 1e+18 + 3;   long long mod = 1e+9 + 7;   long long freq[26] = {0}, vis[N];   long long maxv = -1;   long long sz = 0;   void dfs(string &s, vector<vector<long long>> &gr, long long ind) {     vis[ind] = 1;     sz++;     freq[s[ind] - (long long) a ]++;     for (auto it : gr[ind])       if (!vis[it]) dfs(s, gr, it);   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long t;     cin >> t;     while (t--) {       long long n;       long long k;       cin >> n >> k;       string s;       for (long long i = 0; i <= n; i++) vis[i] = 0;       vector<vector<long long>> gr(n + 1);       long long moves = 0;       cin >> s;       for (long long i = 0; i <= n - 1; i++) {         if (i + k < n) gr[i].push_back(i + k), gr[i + k].push_back(i);         if (i - k >= 0) gr[i].push_back(i - k), gr[i - k].push_back(i);         gr[i].push_back(n - i - 1);         gr[n - i - 1].push_back(i);       }       for (long long i = 0; i <= n - 1; i++) {         if (vis[i]) continue;         dfs(s, gr, i);         for (long long x = 0; x <= 25; x++) maxv = max(maxv, freq[x]);         moves += (sz - maxv);         for (long long x = 0; x <= 25; x++) freq[x] = 0;         maxv = -1;         sz = 0;       }       cout << moves <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 30;   int Par[N], cnt_S, cnt_M, ok = 1, n, m;   struct Edge {     int v, u;     char col;     bool mark;   } E[N];   int Find(int x) { return (Par[x] == x ? x : Par[x] = Find(Par[x])); }   bool Union(int e) {     int x = Find(E[e].v), y = Find(E[e].u);     if (x == y) return 0;     Par[x] = y;     return 1;   }   int main() {     cin >> n >> m;     if ((n - 1) & 1) ok = 0;     for (int i = 0; i < m; i++) cin >> E[i].v >> E[i].u >> E[i].col;     for (int i = 0; i < N; i++) Par[i] = i;     for (int i = 0; i < m; i++)       if (E[i].col ==  M ) Union(i);     for (int i = 0; i < m; i++)       if (E[i].col ==  S  && Union(i)) E[i].mark = true, cnt_S++;     for (int i = 0; i < N; i++) Par[i] = i;     for (int i = 0; i < m; i++)       if (E[i].mark) Union(i);     for (int i = 0; i < m; i++)       if (cnt_S != (n - 1) >> 1 && E[i].col ==  S  && Union(i))         E[i].mark = true, cnt_S++;     for (int i = 0; i < m; i++)       if (E[i].col ==  M  && Union(i)) E[i].mark = true, cnt_M++;     if (cnt_S != (n - 1) >> 1 || cnt_M != (n - 1) >> 1 || !ok)       return cout <<  -1 n , 0;     cout << n - 1 <<   n ;     for (int i = 0; i < m; i++)       if (E[i].mark) cout << i + 1 <<    ;     return (0);   }
#include <bits/stdc++.h>   using namespace std;   const unsigned long long INF = 1000 * 1000 * 1000;   const double eps = 1e-9;   int main() {     string s;     cin >> s;     int pos = 0;     for (char c =  z ; c >=  a ; c--) {       int tek = pos;       for (int i = tek; i < s.size(); i++)         if (s[i] == c) {           cout << s[i];           pos = i;         }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void addEdge(vector<long long> adj[], long long u, long long v) {     adj[u].push_back(v);     adj[v].push_back(u);   }   void DFSUtil(vector<long long> adj[], long long v, bool visited[]) {     visited[v] = true;     for (long long i = 0; i < adj[v].size(); ++i)       if (!visited[adj[v][i]]) DFSUtil(adj, adj[v][i], visited);   }   long long f1(vector<long long> adj[], long long n) {     bool* visited = new bool[n];     long long count = 0;     for (long long v = 0; v < n; v++) visited[v] = false;     for (long long v = 0; v < n; v++) {       if (visited[v] == false) {         DFSUtil(adj, v, visited);         count += 1;       }     }     return count;   }   bool isCyclicUtil(vector<long long> adj[], long long v, bool visited[],                     long long parent) {     bool flag = false;     visited[v] = true;     for (long long i = 0; i < adj[v].size(); ++i) {       if (!visited[adj[v][i]]) {         if (isCyclicUtil(adj, adj[v][i], visited, v)) flag = true;       } else if (adj[v][i] != parent)         flag = true;     }     return flag;   }   long long isCyclic(vector<long long> adj[], long long n) {     bool* visited = new bool[n];     for (long long i = 0; i < n; i++) visited[i] = false;     long long ans = 0;     for (long long u = 0; u < n; u++) {       if (!visited[u]) {         if (isCyclicUtil(adj, u, visited, -1)) {           ans++;         }       }     }     return ans;   }   void solve() {     long long n, m;     cin >> n >> m;     vector<long long> adj[n];     for (long long i = 0; i < m; i++) {       long long x, y;       cin >> x >> y;       x--;       y--;       adj[x].push_back(y);       adj[y].push_back(x);     }     long long x = f1(adj, n);     long long y = isCyclic(adj, n);     cout << x - y << endl;   }   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     solve();     return 0;   }