malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   void no(int ex = -1) { cout << ex <<   n ; }   void win(bool bl) {     if (bl)       cout <<  YES ;     else       cout <<  NO ;     cout <<   n ;   }   const int N = 2 * 100000;   const int mod = 998244353;   double T, n, m, k, p, res, pr;   bool bw;   string str;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> T;     while (T--) {       cin >> n;       cin >> pr;       bw = false;       for (int i = 1; i < n; i++) {         cin >> k;         if (abs(k - pr) >= 2) {           bw = true;           p = i;         }         pr = k;       }       if (bw)         cout <<  YES               <<   n               << p <<     << p + 1 <<   n ;       else         cout <<  NO               <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int M = 1000000007;   const int MM = 998244353;   const long double PI = acos(-1);   long long power(long long b, long long e, long long m) {     if (e == 0) return 1;     if (e & 1) return b * power(b * b % m, e / 2, m) % m;     return power(b * b % m, e / 2, m);   }   long long power(long long b, long long e) {     if (e == 0) return 1;     if (e & 1) return b * power(b * b, e / 2);     return power(b * b, e / 2);   }   template <typename T, typename U>   static inline void amin(T &x, U y) {     if (y < x) x = y;   }   template <typename T, typename U>   static inline void amax(T &x, U y) {     if (x < y) x = y;   }   template <typename T, typename U>   ostream &operator<<(ostream &os, const pair<T, U> &p) {     return os <<  (  << p.first <<  ,  << p.second <<  ) ;   }   template <typename T>   struct fenwick {     vector<T> bit;     int n;     void build(int n_) {       n = n_;       bit.resize(n + 1);       for (int i = 1; i <= n; ++i) bit[i] = T(0);     }     void update(int pos, T val) {       for (; pos <= n; pos += pos & -pos) bit[pos] = (bit[pos] + val) % M;     }     T get(int r) {       T x{};       for (; r; r -= r & -r) x = (x + bit[r]) % M;       return x;     }     T query(int l, int r) { return (get(r) - get(l - 1) + M) % M; }   };   fenwick<long long> fenw1, fenw2;   const int N = 5e5 + 5;   int b[N];   long long a[N];   int _runtimeTerror_() {     int n;     cin >> n;     for (int i = 1; i <= n; ++i) cin >> a[i], b[i] = i;     sort(b + 1, b + 1 + n, [&](int x, int y) { return a[x] < a[y]; });     long long ans = 0;     fenw1.build(n);     fenw2.build(n);     for (int i = 1; i <= n; ++i) {       fenw1.update(b[i], b[i]);       fenw2.update(b[i], n - b[i] + 1);       long long u = 1LL * (fenw1.get(b[i])) * (n - b[i] + 1) % M;       u += 1LL * b[i] * (fenw2.query(b[i] + 1, n)) % M;       u %= M;       ans += a[b[i]] * 1LL * u % M;       ans %= M;     }     cout << ans <<   n ;     return 0;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int TESTS = 1;     while (TESTS--) _runtimeTerror_();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   const int M = 1e9 + 7;   const int INF = 2e9 + 5;   const int rx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};   const int ry[8] = {0, -1, 0, 1, 1, -1, 1, -1};   mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     vector<pair<long long, long long> > a(n);     long long sumx = 0;     long long sumy = 0;     for (int i = 0; i < n; i++) {       cin >> a[i].first >> a[i].second;       sumx += a[i].first;       sumy += a[i].second;     }     long long res = 0;     for (int i = 0; i < n; i++) {       res += (n - 1) * a[i].first * a[i].first - a[i].first * (sumx - a[i].first);       res += (n - 1) * a[i].second * a[i].second -              a[i].second * (sumy - a[i].second);     }     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<vector<int>> g;   vector<int> a;   int n;   vector<map<int, int>> dp;   int ans = 0;   int gcd(int a, int b) {     while (b) {       a %= b;       swap(a, b);     }     return a;   }   void dfs(int v, int p = -1) {     for (auto to : g[v]) {       if (to != p) {         dfs(to, v);         if (gcd(a[v], a[to]) != 1) {           for (auto i : dp[to]) {             int y = gcd(a[v], i.first);             if (y != 1) {               for (auto c : dp[v])                 if (gcd(c.first, i.first) != 1)                   ans = max(ans, i.second + c.second);             }           }           for (auto i : dp[to]) {             int y = gcd(a[v], i.first);             if (y != 1) {               dp[v][y] = max(dp[v][y], i.second + 1);               ans = max(ans, i.second + 1);             }           }         }       }     }   }   signed main() {     std::ios_base::sync_with_stdio(0), cin.tie(0);     cin >> n;     g.resize(n);     a.resize(n);     for (int i = 0; i < n; ++i) {       cin >> a[i];     }     dp.resize(n);     for (int i = 0; i < n - 1; ++i) {       int x, y;       cin >> x >> y;       x--, y--;       g[x].push_back(y);       g[y].push_back(x);     }     for (int i = 0; i < n; ++i) {       if (a[i] != 1) {         ans = 1;         dp[i][a[i]] = 1;       }     }     if (!ans) {       cout << 0;       return 0;     }     dfs(0);     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1000010;   const int md = 1e9 + 7;   int mul(int a, int b) { return (long long)a * b % md; }   char s[N];   int n, m, nn, x[N], z[N];   bool start[N];   int main() {     scanf( %d %d %s , &n, &m, s);     nn = strlen(s);     for (int i = 0; i < m; i++) {       scanf( %d , &x[i]);       x[i]--;       start[x[i]] = true;     }     for (int i = 1, l = -1, r = -1; i < nn; i++) {       int &k = z[i];       if (i < r) {         k = min(r - i, z[i - l]);       }       for (; i + k < nn && s[k] == s[i + k]; k++)         ;       if (i + k > r) {         l = i;         r = i + k;       }     }     for (int i = 0; i < m - 1; i++) {       int p = x[i + 1] - x[i];       if (p + z[p] < nn) {         puts( 0 );         return 0;       }     }     int ans = 1;     int r = -1;     for (int i = 0; i < n; i++) {       if (start[i]) {         r = i + nn;       }       if (i >= r) {         ans = mul(ans, 26);       }     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long int s;     cin >> s;     long long int tot = 0;     while (s >= 10) {       tot += s / 10 * 10;       s = s / 10 + s % 10;     }     cout << tot + s << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1;     cin >> t;     while (t--) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   const long long MOD = 998244353;   const long long EPS = 1e-9;   long long mpow(long long a, long long b, long long p = MOD) {     a = a % p;     long long res = 1;     while (b > 0) {       if (b & 1) res = (res * a) % p;       a = (a * a) % p;       b = b >> 1;     }     return res % p;   }   const long long N = 1e6 + 5;   long long dp[N];   long long fac[N];   long long ncm(long long n, long long m) {     if (m > n) return 0;     long long ans = fac[n];     ans = (ans * mpow(fac[m], MOD - 2)) % MOD;     ans = (ans * mpow(fac[n - m], MOD - 2)) % MOD;     return ans;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     fac[0] = 1;     for (long long i = 1; i < N; i++) {       fac[i] = (i * fac[i - 1]) % MOD;     }     long long n;     cin >> n;     long long a[n];     for (long long i = 0; i < n; i++) cin >> a[i];     dp[n] = 1;     long long ans = 0;     for (long long i = n - 1; i >= 0; i--) {       dp[i] = dp[i + 1];       if (a[i] <= 0) continue;       for (long long j = i + 1; j < n; j++) {         if (j - i < a[i]) continue;         long long rem = a[i] - 1;         long long oo = j - i - 1;         long long c = ncm(oo, rem) * dp[j + 1];         ans += c;         ans %= MOD;         dp[i] += c;         dp[i] %= MOD;       }     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   bool ckmin(T& a, const T& b) {     return b < a ? a = b, 1 : 0;   }   template <class T>   bool ckmax(T& a, const T& b) {     return a < b ? a = b, 1 : 0;   }   const long long MOD = (long long)(1e9) + 7;   long long getVal(pair<pair<int, int>, long long> p) {     return (p.second * (p.first.second - p.first.first + 1)) % MOD;   }   void pr(stack<pair<pair<int, int>, long long>> st) {     cout << st.top().first.first <<     << st.top().first.second <<              << st.top().second <<   n ;     st.pop();     if (!st.empty()) pr(st);   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     string second;     cin >> second;     vector<int> v;     int cur = 0;     for (int i = 0; i < (int)second.size(); i++) {       if (second[i] ==  1 ) {         v.push_back(cur);         cur = 0;       } else {         cur++;       }     }     if ((int)v.size() == 0) {       return cout << (int)second.size() <<   n , 0;       ;     }     long long factor = ((long long)(v[0] + 1) * (cur + 1)) % MOD;     v.erase(v.begin());     stack<pair<pair<int, int>, long long>> st;     long long cursum = 0;     for (int i = 0; i < (int)v.size(); i++) {       long long ori = cursum;       while (!st.empty()) {         if (v[i] >= st.top().first.first) {           cursum -= getVal(st.top());           cursum %= MOD;           cursum += MOD;           cursum %= MOD;           if (v[i] < st.top().first.second) {             st.top().first.first = v[i] + 1;             cursum += getVal(st.top());             cursum %= MOD;             break;           } else {             st.pop();           }         } else {           break;         }       }       st.push(make_pair(make_pair(0, v[i]), (ori + 1) % MOD));       cursum += getVal(st.top());       cursum %= MOD;     }     cursum++;     cursum %= MOD;     long long res = (factor * cursum) % MOD;     return cout << res <<   n , 0;     ;   }
#include <bits/stdc++.h>   using namespace std;   long long M = 1e15 + 37;   const long long N = 1000 + 10;   const long long IM = 1e18;   const long long PI = 3.14159265;   void PV(vector<long long> v) {     for (long long i = 0; i < v.size(); i++) cout << v[i] <<    ;     cout <<   n ;   }   void PA(long long v[], long long n, long long x = 0) {     for (long long i = x; i < n + x; i++) cout << v[i] <<    ;     cout <<   n ;   }   void IN(long long a[], long long n, long long x = 0) {     for (long long i = x; i < n + x; i++) cin >> a[i];   }   inline void PTN(long long n = 1, long long a = 0, long long b = 0,                   long long c = 0) {     if (n--) cout << a <<    ;     if (n--) cout << b <<    ;     if (n--) cout << c <<    ;     cout <<   n ;   }   inline void op() {}   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     op();     long long i, j, x, y, u, l;     long long tt = 1;     {       i = j = x = y = u = l = 0;       string s;       cin >> s;       l = s.size();       for (i = 0; i < l; i++) {         char c;         if (i && s[i] == s[i - 1]) {           for (c =  a ; c <=  z ; c++) {             if (c != s[i]) {               if (i < l) {                 if (c != s[i + 1]) {                   s[i] = c;                   break;                 }               }             }           }         }       }       cout << s <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   int dp[1000 + 1][3];   int v[1000 + 1];   inline int getmin(int a, int b) {     if (a < b) return a;     return b;   }   int main() {     int n, i;     scanf( %d , &n);     for (i = 1; i <= n; i++) scanf( %d , &v[i]);     dp[1][0] = 1;     if (v[1] % 2 == 1)       dp[1][1] = 0;     else       dp[1][1] = n;     if (v[1] >= 2)       dp[1][2] = 0;     else       dp[1][2] = n;     for (i = 2; i <= n; i++) {       dp[i][0] = getmin(dp[i - 1][0], getmin(dp[i - 1][1], dp[i - 1][2])) + 1;       if (v[i] % 2 == 1)         dp[i][1] = getmin(dp[i - 1][0], dp[i - 1][2]);       else         dp[i][1] = n;       if (v[i] >= 2)         dp[i][2] = getmin(dp[i - 1][0], dp[i - 1][1]);       else         dp[i][2] = n;     }     printf( %d , getmin(dp[n][0], getmin(dp[n][1], dp[n][2])));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T, typename U>   static inline void amn(T &x, U y) {     if (y < x) x = y;   }   template <typename T, typename U>   static inline void amx(T &x, U y) {     if (x < y) x = y;   }   const long long MOD = 1e9 + 7;   const long long INF = 1e18;   const long long N = 5e5 + 5;   long long top(long long x, long long y) {     long long f = x / y;     if (x % y) f++;     return f;   }   bool cmp(pair<long long, long long> &a, pair<long long, long long> &b) {     return a.first < b.first;   }   void solve() {     long long n, m, x;     cin >> n >> m >> x;     vector<pair<long long, long long> > v;     for (long long i = 1; i <= n; i++) {       v.push_back({0, i});     }     long long sa = top(n, m), sb = n / m;     long long A = (n % m) * sa;     for (long long i = 1; i <= x; i++) {       for (long long j = 0; j < A; j++) {         v[j].first++;       }       for (long long j = 0; j < A; j += sa) {         cout << sa;         for (long long k = j; k < j + sa; k++) {           cout <<     << v[k].second;         }         cout << endl;       }       for (long long j = A; j < n; j += sb) {         cout << sb;         for (long long k = j; k < j + sb; k++) {           cout <<     << v[k].second;         }         cout << endl;       }       sort(v.begin(), v.end(), cmp);     }     cout << endl;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long test_case = 1;     cin >> test_case;     while (test_case--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int binarySearch(int a[], int l, int r, int x);   int main() {     int n, m, i, temp;     vector<int> v1;     vector<int> v2;     scanf( %d %d , &n, &m);     for (i = 0; i < n; i++) {       scanf( %d , &temp);       v1.push_back(temp);     }     for (i = 0; i < m; i++) {       scanf( %d , &temp);       v2.push_back(temp);     }     for (i = 0; i < n; i++) {       if (find(v2.begin(), v2.end(), v1[i]) != v2.end()) {         printf( %d  , v1[i]);       }     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 2e4 + 3;   const long long MOD = 998244353;   int a[MAX];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n, k;     cin >> n >> k;     int s = 2 * n, mid = n, one = 0, left = 0;     for (int i = 1; i <= k; i++) {       cin >> a[i];       if (a[i] % 2) {         a[i]--;         left++;       }     }     for (int i = 1; i <= k; i++) {       if (a[i] >= 4) {         int need = a[i] / 4;         if (mid <= need) {           a[i] -= mid * 4;           mid = 0;         } else {           a[i] %= 4;           mid -= need;         }       }     }     if (mid == 0) {       for (int i = 1; i <= k; i++) s -= a[i] / 2;       s -= left;       if (s >= 0)         cout <<  YES ;       else         cout <<  NO ;       return 0;     }     for (int i = 1; i <= k; i++) {       if (a[i] == 2) {         if (s) {           s--;           continue;         }         if (mid) {           mid--;           left--;           continue;         }         left += 2;       }     }     if (s + mid * 2 >= left)       cout <<  YES ;     else       cout <<  NO ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, a[200005];     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , &a[i]);     int s, t, m = 0;     for (s = 0; s < n;) {       t = s + 1;       while (a[t] <= a[t - 1] * 2 && t < n) t++;       int res = t - s;       m = max(m, res);       s = t;     }     printf( %d , m);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int cmp(string s1, string s2) {     if (s1 ==  rock  && s2 ==  scissors ) return 1;     if (s1 ==  scissors  && s2 ==  paper ) return 1;     if (s1 ==  paper  && s2 ==  rock ) return 1;     return 0;   }   int main() {     string s1, s2, s3;     cin >> s1 >> s2 >> s3;     if (cmp(s1, s2) && cmp(s1, s3)) {       putchar( F );       return 0;     }     if (cmp(s2, s1) && cmp(s2, s3)) {       putchar( M );       return 0;     }     if (cmp(s3, s1) && cmp(s3, s2)) {       putchar( S );       return 0;     }     putchar( ? );   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 7;   const long long mod = 1e9 + 7;   long long mpow(long long a, long long b) {     long long res = 1;     while (b) {       if (b % 2 == 1) {         res = res * a;       }       b = b / 2;       a = a * a;     }     return res;   }   long long pow1(long long a, long long b) {     long long res = 1;     while (b) {       if (b % 2 == 1) res = res * a % mod;       b = b / 2;       a = a * a % mod;     }     return res;   }   int main() {     long long k;     cin >> k;     long long b = 1;     b = mpow(2LL, k - 1) - 1 + mpow(2, k) - 1 - (mpow(2, k - 1));     long long ans = pow1(4, b);     ans = ans * 6 % mod;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   long long ToInt(const T &x) {     stringstream s;     s << x;     long long r;     s >> r;     return r;   }   template <class T>   string ToString(const T &x) {     stringstream s;     s << x;     return s.str();   }   int main() {     string str, str2;     cin >> str;     if (str.length() == 1) return cout << 1 << endl, 0;     long long N = str[0] -  0 ;     N++;     for (int i = 1; i < str.length(); i++) str2 +=  0 ;     string temp = ToString(N);     str2 = temp + str2;     printf( %lld n , ToInt(str2) - ToInt(str));   }
#include <bits/stdc++.h>   using namespace std;   int a, b, c, d, e, f, g, h, i, j, k;   int father[100005][20];   vector<int> tree[100005];   int deep[100005];   int que[100005], num[100005];   int K;   int an;   void soso(int x) {     int ii, jj, kk;     que[++que[0]] = x;     deep[x] = deep[father[x][0]] + 1;     for (ii = 0; ii < tree[x].size(); ii++) {       jj = tree[x][ii];       if (jj == father[x][0]) continue;       father[jj][0] = x;       soso(jj);     }   }   void Build_LCA() {     int ii, jj, kk;     for (jj = 1; jj <= 19; jj++)       for (ii = 1; ii <= a; ii++)         father[ii][jj] = father[father[ii][jj - 1]][jj - 1];   }   int LCA(int x, int y) {     int ii, jj, kk;     if (deep[x] < deep[y]) swap(x, y);     for (ii = 18; ii >= 0; ii--)       if (deep[father[x][ii]] >= deep[y]) x = father[x][ii];     if (x == y) return x;     for (ii = 18; ii >= 0; ii--)       if (father[x][ii] != father[y][ii]) x = father[x][ii], y = father[y][ii];     return father[x][0];   }   int Dis(int x, int y) {     int u = LCA(x, y);     return deep[x] + deep[y] - 2 * deep[u];   }   int Add(set<pair<int, int> >& E, int x, int vv) {     int R = 0;     set<pair<int, int> >::iterator now;     if (vv == 1) E.insert(make_pair(num[x], x));     now = E.find(make_pair(num[x], x));     set<pair<int, int> >::iterator now1 = now;     set<pair<int, int> >::iterator pre, next;     if (now != E.begin()) {       pre = --now;       R += Dis((*pre).second, x);     }     now = now1;     next = ++now;     if (next != E.end()) {       R += Dis((*next).second, x);     }     now = now1;     if (now != E.begin() && next != E.end())       R -= Dis((*pre).second, (*next).second);     if (vv == -1) E.erase(now);     return R * vv;   }   bool Check(int x) {     int ii, jj, kk;     int now = 0;     set<pair<int, int> > GG;     for (ii = 1; ii <= x - 1; ii++) now += Add(GG, ii, 1);     for (ii = x; ii <= a; ii++) {       now += Add(GG, ii, 1);       set<pair<int, int> >::iterator in = GG.end();       in--;       int tmp = Dis((*GG.begin()).second, (*in).second);       if (now + tmp <= (K << 1)) return true;       now += Add(GG, ii - x + 1, -1);     }     return false;   }   int main() {     cin >> a >> K;     K--;     for (i = 1; i < a; i++) {       cin >> c >> d;       tree[c].push_back(d);       tree[d].push_back(c);     }     soso(1);     Build_LCA();     for (i = 1; i <= a; i++) num[que[i]] = i;     int low = 1, high = a, mid;     while (low <= high) {       mid = (low + high) >> 1;       if (Check(mid)) {         an = max(an, mid);         low = mid + 1;       } else         high = mid - 1;     }     cout << an << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int a[505], b[505];   void solve() {     long long int n;     cin >> n;     for (long long int i = 1; i <= n; i++) cin >> a[i];     for (long long int i = 1; i <= n; i++) cin >> b[i];     long long int x = (n + 1) / 2;     if (n % 2 == 1 && a[x] != b[x]) {       cout <<  No n ;       return;     }     multiset<pair<long long int, long long int> > m;     if (n % 2) {       for (long long int i = 1; i < x; i++) m.insert({a[x + i], a[x - i]});       for (long long int i = 1; i < x; i++) {         pair<long long int, long long int> p = {b[x + i], b[x - i]};         if (m.find(p) != m.end()) {           m.erase(m.find(p));           continue;         }         swap(p.first, p.second);         if (m.find(p) != m.end()) {           m.erase(m.find(p));           continue;         }         cout <<  No n ;         return;       }     } else {       for (long long int i = 0; i < x; i++) m.insert({a[x - i], a[x + i + 1]});       for (long long int i = 0; i < x; i++) {         pair<long long int, long long int> p = {b[x - i], b[x + i + 1]};         if (m.find(p) != m.end()) {           m.erase(m.find(p));           continue;         }         swap(p.first, p.second);         if (m.find(p) != m.end()) {           m.erase(m.find(p));           continue;         }         cout <<  No n ;         return;       }     }     cout <<  Yes n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int qc;     cin >> qc;     for (long long int i = 1; i <= qc; i++) solve();   }
#include <bits/stdc++.h>   #define ll long long   #define f(n) for(ll i=0;i<n;i++)   #define mod 998244353   #define vl vector<ll>   #define pb push_back   #define mk make_pair   #define forn(i, n) for (int i = 0; i < int(n); i++)   #define nl   n    #define IOS ios_base::sync_with_stdio(false);       #include <iostream>   using namespace std;          void solve()   {           ll n;           cin>>n;           ll a[n];           for(ll i=0;i<n;i++)           {               cin>>a[i];           }           sort(a,a+n);           ll v=0,s=0;               for(int i=2;i<n;i++)           {               s+=a[i-2];               v-=(a[i]*(i-1));               v+=s;           }           cout<<v<<endl;   }          void init_code()   {       #ifndef ONLINE_JUDGE       freopen( input.txt ,  r , stdin);       freopen( output.txt ,  w , stdout);       #endif    }           int main()   {       init_code();      IOS      cin.tie(NULL);      cout.tie(NULL);      ll t;      cin>>t;      //t=1;      while(t--)      {         solve();      }      return 0;   }