malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const int maxn = 200050;   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   int isprime(int x) {     for (int i = 2; i <= sqrt(x); i++) {       if (x % i == 0) return 0;     }     return 1;   }   int judge(char ch) {     if (ch ==  a  || ch ==  u )       return 1;     else       return 0;   }   vector<int> e[maxn];   int ans[maxn];   vector<int> v[maxn];   void dfs(int x) {     for (int i = 0; i < e[x].size(); i++) {       dfs(e[x][i]);       for (int j = 0; j < v[e[x][i]].size(); j++) {         v[x].push_back(v[e[x][i]][j]);       }     }   }   int main() {     int n;     string a, b;     cin >> n >> a >> b;     int maxsub[3] = {0};     int adds = 0;     int flg = 0;     for (int i = 0; i < n / 2; i++) {       char s[4];       s[0] = a[i];       s[1] = a[n - i - 1];       s[2] = b[i];       s[3] = b[n - i - 1];       if (a[i] == b[i] && s[1] == s[3]) {         continue;       } else if (a[i] == b[i] || s[1] == s[3]) {         adds++;         continue;       } else if ((s[0] == s[1] && s[2] == s[3])) {         continue;       } else if (s[0] == s[3] && s[1] == s[2]) {         continue;       } else if (s[2] == s[3]) {         adds++;       } else if (s[0] == s[3] || s[1] == s[2]) {         adds++;       } else {         adds += 2;       }     }     if (n % 2 == 1) {       if (a[n / 2] != b[n / 2]) adds++;     }     int sub = 0;     if (maxsub[2] >= 2)       sub = 4;     else if (maxsub[2] == 1)       sub = 2 + min(maxsub[1], 1);     else if (maxsub[2] == 0)       sub = min(maxsub[1], 2);     cout << adds - sub;   }
#include <bits/stdc++.h>   using namespace std;   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long a, b;     cin >> a >> b;     if (a == b) {       cout <<  infinity  <<   n ;       return 0;     }     if (a < b) {       cout << 0 <<   n ;       return 0;     }     long long ans = 0;     long long n = a - b;     for (long long i = 1; i <= sqrt(n); i++) {       if (n % i == 0) {         if (i == n / i) {           if (i > b) ans++;         } else {           if (i > b) ans++;           if (n / i > b) ans++;         }       }     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long i, j, t, a, b, m, n, c, d, y, x, k, s;     t = 1;     while (t--) {       string s1, s2;       cin >> s1 >> s2;       if (s1 == s2)         cout << s1;       else         cout << 1;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b, c;     scanf( %d%d%d , &a, &b, &c);     int aweek = a / 3;     int bweek = b / 2;     int cweek = c / 2;     int ans = min(aweek, min(bweek, cweek));     ans -= 2;     ans = max(ans, 0);     a -= ans * 3;     b -= ans * 2;     c -= ans * 2;     ans *= 7;     int tmp = 0;     for (int i = 1; i <= 7; i++) {       int tmpa = a, tmpb = b, tmpc = c;       int total = 0;       int cnt = i;       while (true) {         if (cnt == 1 || cnt == 4 || cnt == 7) {           if (tmpa > 0)             tmpa--;           else             break;         } else if (cnt == 2 || cnt == 6) {           if (tmpb > 0)             tmpb--;           else             break;         } else {           if (tmpc > 0)             tmpc--;           else             break;         }         total++;         cnt++;         if (cnt == 8) cnt = 1;       }       tmp = max(tmp, total);     }     printf( %d , ans + tmp);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 5e5 + 10;   int n, m, q, times[maxn];   long long a[maxn];   int main() {     scanf( %d%d%d , &n, &m, &q);     for (int i = 1; i <= n; ++i) {       int x;       scanf( %d , &x);       a[i] = (long long)(times[x]++) * m + x;     }     sort(a + 1, a + 1 + n);     for (int i = 1; i <= n; ++i) a[i] -= i;     while (q--) {       long long k;       scanf( %lld , &k);       k += lower_bound(a + 1, a + 1 + n, k - n) - a - 1 - n;       printf( %lld n , (k - 1) % m + 1);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename _T>   inline void _DBG(const char *s, _T x) {     cerr << s <<   =   << x <<   n ;   }   template <typename _T, typename... args>   void _DBG(const char *s, _T x, args... a) {     while (*s !=  , ) cerr << *s++;     cerr <<   =   << x <<  , ;     _DBG(s + 1, a...);   }   template <typename TP>   struct pSegmentTree {     long long MAX;     TP init;     struct node {       TP val;       node *left = nullptr, *right = nullptr;       long long l, r;       node(long long L, long long R, TP v) : val(v), l(L), r(R) {}     };     vector<node *> roots;     pSegmentTree(long long n, TP zero) : init(zero) {       MAX = 1LL << (64 - __builtin_clzll(n));       roots.push_back(new node(0, MAX - 1, init));     }     void check(node *root) {       long long m = (root->l + root->r) / 2;       if (root->left == nullptr) root->left = new node(root->l, m, init);       if (root->right == nullptr) root->right = new node(m + 1, root->r, init);     }     node *add(node *root, long long id, TP v) {       node *res = new node(*root);       res->val += v;       if (res->l == res->r) return res;       long long m = (res->l + res->r) / 2;       check(res);       if (id <= m)         res->left = add(res->left, id, v);       else         res->right = add(res->right, id, v);       return res;     }     TP ask(node *root, long long a, long long b) {       if (root->r < a || b < root->l) return init;       if (a <= root->l && root->r <= b) return root->val;       check(root);       return ask(root->left, a, b) + ask(root->right, a, b);     }     void update(long long id, TP v, int state = -1) {       if (state == -1) state += (int)(roots).size();       assert(state < (int)(roots).size());       roots.push_back(add(roots[state], id, v));     }     TP query(long long a, long long b, int state = -1) {       if (state == -1) state += (int)(roots).size();       assert(state < (int)(roots).size());       return ask(roots[state], a, b);     }   };   const int N = 1e5 + 7;   int n, k, t[N], p[N];   vector<int> pos[N];   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> k;     for (int i = 1; i <= n; i++) {       cin >> t[i];       pos[t[i]].push_back(i);       if ((int)(pos[t[i]]).size() <= k)         p[i] = 0;       else         p[i] = pos[t[i]][(int)(pos[t[i]]).size() - k - 1];     }     pSegmentTree<int> tree(n + 7, 0);     for (int i = 1; i <= n; i++) tree.update(p[i], 1);     int q, last = 0;     cin >> q;     while (q--) {       int l, r;       cin >> l >> r;       l = (l + last) % n + 1;       r = (r + last) % n + 1;       if (l > r) swap(l, r);       last = tree.query(0, l - 1, r) - tree.query(0, l - 1, l - 1);       cout << last <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int t;     cin >> t;     while (t--) {       string s;       cin >> s;       int zero = 0, one = 0;       for (char i : s)         if (i ==  0 )           zero++;         else           one++;       if (min(zero, one) % 2 == 1)         cout <<  DA n ;       else         cout <<  NET n ;     }   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<pair<int, int>, pair<int, int> > > way[222222];   queue<int> turn;   bool was[222222];   int i, n, m, ans[222222], cost[222222];   int main() {     cin >> n >> m;     for (i = 1; i <= m; i++) {       int a, b, c;       cin >> a >> b >> c;       cost[a] += c;       cost[b] += c;       way[a].push_back(make_pair(make_pair(i, c), make_pair(b, 0)));       way[b].push_back(make_pair(make_pair(i, c), make_pair(a, 1)));     }     for (i = 1; i <= n; i++) cost[i] /= 2;     turn.push(1);     memset(was, 1, sizeof(was));     while (!turn.empty()) {       int t = turn.front();       was[t] = 0;       turn.pop();       for (i = 0; i < way[t].size(); i++)         if (was[way[t][i].second.first]) {           int u = way[t][i].second.first;           ans[way[t][i].first.first] = way[t][i].second.second;           cost[u] -= way[t][i].first.second;           if (cost[u] == 0 && u != n) turn.push(u);         }     }     for (i = 1; i <= m; i++) cout << ans[i] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<int> a[4];   vector<long long> sum[4];   int hasha[200050], hashb[200050];   int c[200050];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n, m, k, t;     cin >> n >> m >> k;     memset(hasha, 0, sizeof(hasha));     memset(hashb, 0, sizeof(hashb));     for (int i = 1; i <= n; i++) cin >> c[i];     cin >> t;     for (int i = 0; i < t; i++) {       int x;       cin >> x;       hasha[x] = 1;     }     cin >> t;     for (int i = 0; i < t; i++) {       int x;       cin >> x;       hashb[x] = 1;     }     for (int i = 1; i <= n; i++) {       if (hasha[i] && hashb[i])         a[3].push_back(c[i]);       else if (!hasha[i] && hashb[i])         a[2].push_back(c[i]);       else if (hasha[i] && !hashb[i])         a[1].push_back(c[i]);       else         a[0].push_back(c[i]);     }     for (int i = 0; i < 4; i++) sort(a[i].begin(), a[i].end());     for (int i = 0; i < 4; i++) sum[i].push_back(0);     for (int i = 0; i < 4; i++) {       for (int j = 0; j < a[i].size(); j++)         sum[i].push_back(sum[i].back() + a[i][j]);     }     long long ans = 1e18 + 1;     for (int i = 0; i <= a[3].size(); i++) {       long long cost = sum[3][i];       int need = max(0, k - i);       if (need > a[1].size() || need > a[2].size() || i + need * 2 > m) continue;       cost += sum[1][need], cost += sum[2][need];       int left = m - i - 2 * need;       if (a[1].size() - need + a[2].size() - need + a[0].size() < left) continue;       if (left > 0) {         int l = 0, r = 1e9;         while (l < r) {           int mid = (l + r) / 2;           int cnt = 0;           int h = upper_bound(a[0].begin(), a[0].end(), mid) - a[0].begin();           cnt += max(0, h);           h = upper_bound(a[1].begin(), a[1].end(), mid) - a[1].begin();           cnt += max(0, h - need);           h = upper_bound(a[2].begin(), a[2].end(), mid) - a[2].begin();           cnt += max(0, h - need);           if (cnt >= left)             r = mid;           else             l = mid + 1;         }         int mid = l, cnt = 0;         int h = upper_bound(a[0].begin(), a[0].end(), mid) - a[0].begin();         cnt += max(0, h);         cost += sum[0][h];         h = upper_bound(a[1].begin(), a[1].end(), mid) - a[1].begin();         cnt += max(0, h - need);         if (h > need) cost += sum[1][h] - sum[1][need];         h = upper_bound(a[2].begin(), a[2].end(), mid) - a[2].begin();         cnt += max(0, h - need);         if (h > need) cost += sum[2][h] - sum[2][need];         if (cnt > left) cost -= mid * (cnt - left);       }       ans = min(ans, cost);     }     if (ans > 1e17) ans = -1;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using namespace std::chrono;   const long long int N = 10e5 + 10;   const long long int M = 32767;   long long int a[100050] = {0};   long long int b[100050] = {0};   int main() {     long long int t;     cin >> t;     while (t--) {       int n, k;       int segment = 0;       map<int, int> m;       cin >> n >> k;       for (int i = 0; i < n; i++) {         cin >> a[i];         b[i] = a[i];       }       sort(b, b + n);       for (int i = 0; i < n - 1; i++) {         m[b[i]] = b[i + 1];       }       for (int i = 0; i < n - 1; i++) {         if ((a[i + 1] != m[a[i]]) || (a[i] == b[n - 1])) {           segment++;         }       }       if (segment < k) {         cout <<  Yes  << endl;       } else {         cout <<  No  << endl;       }       memset(a, 0, n * sizeof(a[0]));       memset(b, 0, n * sizeof(a[0]));     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int c[100];   int main() {     int n, k, a;     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> k;       for (int j = 1; j <= k; j++) {         cin >> a;         c[a]++;       }     }     for (int i = 1; i <= 100; i++) {       if (c[i] == n) cout << i <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     string a, b;     cin >> a >> b;     if (a.size() < b.size()) a = string(b.size() - a.size(),  0 ) + a;     if (a.size() > b.size()) b = string(a.size() - b.size(),  0 ) + b;     if (a < b)       cout <<  <  << endl;     else if (a > b)       cout <<  >  << endl;     else       cout <<  =  << endl;     return;   }   int main() {     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, a[1005];   map<long long, int> x;   int ans;   void f(long long a, long long b) {     long long cur = a + b;     vector<long long> q;     q.push_back(a);     q.push_back(b);     int len = 2;     x[a]--;     x[b]--;     while (x[cur] > 0) {       x[cur]--;       q.push_back(cur);       a = b;       b = cur;       cur = a + b;       len++;     }     ans = max(len, ans);     for (int i = 0; i < q.size(); i++) x[q[i]]++;   }   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];       x[a[i]]++;     }     ans = x[0];     for (int i = 1; i <= n; i++) {       for (int j = i + 1; j <= n; j++) {         if (a[i] == a[j] && a[i] == 0) continue;         f(a[i], a[j]);         f(a[j], a[i]);       }     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   inline void writeln2() { cout <<   n ; }   inline void writeln() { cout <<   n ; }   inline void readln() {}   template <typename T>   inline void read(T&);   template <typename T>   inline void priws(T);   template <typename T>   inline void print(T);   void err(vector<string>::iterator it) { ++it; }   template <typename Head, typename... Tail>   inline void readln(Head& head, Tail&... tail) {     read(head);     readln(tail...);   }   template <typename Head, typename... Tail>   inline void writeln2(Head head, Tail... tail) {     print(head);     writeln2(tail...);   }   template <typename Head, typename... Tail>   inline void writeln(Head head, Tail... tail) {     priws(head);     writeln2(tail...);   }   template <typename T>   inline void writeln_range(T f, T s) {     if (f != s)       for (auto i = f; i != s; ++i) writeln(*i);   }   template <typename Head, typename... Tail>   inline void err(vector<string>::iterator it, Head head, Tail... tail) {     writeln((*it).substr((*it)[0] ==    ),  = , head);     err(++it, tail...);   }   vector<string> split(const string& s, char c) {     vector<string> v;     stringstream ss(s);     string x;     while (getline(ss, x, c)) v.push_back(x);     return move(v);   }   void run() {     int n, T;     double c;     readln(n, T, c);     vector<int> a(n);     readln(a);     vector<int> p;     readln(p);     int m = p.size();     int j = 0;     double real = 0;     double app = 0;     long long sum = 0;     for (int i = 0; i < (int)(n); ++i) {       if (j == m) break;       sum += a[i];       if (i >= T) sum -= a[i - T];       real = (0.0 + sum) / T;       app = (app + (0.0 + a[i]) / T) / c;       if (p[j] == i + 1) j++, writeln(real, app, fabs(app - real) / real);     }   }   int main() {     run();     return 0;   }   template <typename T>   inline ostream& operator<<(ostream& os, vector<T>& _a);   template <typename T1, typename T2>   inline istream& operator>>(istream& is, pair<T1, T2>& _a) {     return is >> _a.first >> _a.second;   }   template <typename T1, typename T2>   inline ostream& operator<<(ostream& os, pair<T1, T2>& _a) {     return os << _a.first <<     << _a.second;   }   template <typename T>   inline ostream& operator<<(ostream& os, vector<T>& _a) {     if (_a.size())       os << _a[0];     else       os <<   n ;     for (int i = 1; i < _a.size(); ++i)       os <<   n  [is_fundamental<T>::value] << _a[i];     return os;   }   template <typename T>   inline istream& operator>>(istream& is, vector<T>& _a) {     if (_a.size() == 0) {       int _n;       is >> _n;       _a.resize(_n);     }     for (int i = 0; i < _a.size(); ++i) is >> _a[i];     return is;   }   void print(double _a) {     printf(                      %.6f ,         _a);   }   void priws(double _a) { printf( %.6f , _a); }   void read(double& _a) { scanf( %lf , &_a); }   template <typename T>   inline void print(T _a) {     cout <<     << _a;   }   template <typename T>   inline void priws(T _a) {     cout << _a;   }   template <typename T>   inline void read(T& _a) {     cin >> _a;   }
#include <bits/stdc++.h>   #pragma 03   using namespace std;   int mod = 998244353;   int add(int a, int b) {     a += b;     if (a < 0) a += mod;     if (a >= mod) a -= mod;     return a;   }   int main() {     int n, m;     string s, t;     cin >> n >> m >> s >> t;     int pw = 1, res = 0, ans = 0;     for (int i = 0; i < m; i++) {       if (i < n && s[n - i - 1] ==  1 ) res = add(res, pw);       if (t[m - i - 1] ==  1 ) ans = add(ans, res);       pw = add(pw, pw);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void striker() {     int n;     cin >> n;     string s;     cin >> s;     int left_arr[n];     int right_arr[n];     for (int i = 0; i < 2 * n; i++) {       if (i < n)         left_arr[i] = s[i];       else         right_arr[i - n] = s[i];     }     bool flag = false;     sort(left_arr, left_arr + n);     sort(right_arr, right_arr + n);     if (left_arr[0] > right_arr[0])       flag = true;     else if (left_arr[0] < right_arr[0])       flag = false;     else {       cout <<  NO ;       return;     }     for (int i = 1; i < n; i++) {       if (flag && left_arr[i] <= right_arr[i]) {         cout <<  NO ;         return;       } else if (!flag && left_arr[i] >= right_arr[i]) {         cout <<  NO ;         return;       }     }     cout <<  YES ;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     int t = 1;     for (int i = 0; i < t; i++) {       striker();       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     long long n, sx, sy;     cin >> n >> sx >> sy;     vector<pair<long long, long long>> vec(n);     for (int i = 0; i < n; i++) {       cin >> vec[i].first >> vec[i].second;     }     long long ans1 = 0, ans2 = 0, ans3 = 0, ans4 = 0;     if (sy + 1 <= 1000000000) {       for (int i = 0; i < n; i++) {         if (vec[i].second > sy) {           ans1++;         }       }     }     if (sy - 1 >= 0) {       for (int i = 0; i < n; i++) {         if (vec[i].second < sy) {           ans2++;         }       }     }     if (sx + 1 <= 1000000000) {       for (int i = 0; i < n; i++) {         if (vec[i].first > sx) {           ans3++;         }       }     }     if (sx - 1 >= 0) {       for (int i = 0; i < n; i++) {         if (vec[i].first < sx) {           ans4++;         }       }     }     cout << max({ans1, ans2, ans3, ans4}) << endl;     if (max({ans1, ans2, ans3, ans4}) == ans1) {       cout << sx <<     << sy + 1 << endl;     } else if (max({ans1, ans2, ans3, ans4}) == ans2) {       cout << sx <<     << sy - 1 << endl;     } else if (max({ans1, ans2, ans3, ans4}) == ans3) {       cout << sx + 1 <<     << sy << endl;     } else if (max({ans1, ans2, ans3, ans4}) == ans4) {       cout << sx - 1 <<     << sy << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int i, j, k, n, m, an;   int f[(1 << 24)], g[(1 << 24)], h[(1 << 24)];   char p[3];   int main() {     scanf( %d , &n);     for (i = 1; i <= n; i++) {       scanf( %s , p);       int s = 0;       for (j = 0; j <= 2; j++) s |= 1 << (p[j] -  a );       g[s]++;     }     m = (1 << 24) - 1;     for (i = 1; i <= m; i++) {       int A = i & -i, B = i ^ A;       if (!B) {         f[i] = g[i];         continue;       }       int C = B & -B, D = B ^ C;       if (!D) {         f[i] = f[B] + f[D | A] - f[D] + g[A | C];         continue;       }       int E = D & -D, F = D ^ E;       f[i] = f[F] - f[F | E] - f[F | C] - f[F | A] + f[i ^ A] + f[i ^ C] +              f[i ^ E] + g[A | C | E];     }     for (i = 1; i <= m; i++) {       int A = i & -i, B = i ^ A, C = m ^ B, D = m ^ i;       h[i] = h[B] + f[C] - f[D];       an ^= h[i] * h[i];     }     printf( %d n , an);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int p[100010] = {0}, d[100010], n, k, a[100010], ans = 0, ac[100010], flag = 1;   void solve(int x) {     if (x > n) return;     if (p[x] == 0 || (p[x] == x + 1 && flag)) {       if (p[x] == 0)         flag = 0, ans += (x != n), solve(x + 1);       else         solve(x + 1);       return;     }     flag = 0;     ans += d[x];     for (int j = p[x], t; j > 0;) {       t = p[j];       d[j] = 0;       p[j] = 0;       j = t;     }     ans++;     solve(x + 1);   }   int main() {     scanf( %d%d , &n, &k);     for (int i = 0, t; i < k; ++i) {       scanf( %d , &t);       for (int j = 1; j <= t; ++j) {         scanf( %d , a + j);         d[a[j]] = t - j;       }       for (int j = t; j > 1; --j) p[a[j - 1]] = a[j];       for (int j = 1; j <= t; ++j) ac[a[j]] = a[t];     }     solve(1);     printf( %d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     double d, h, v, e;     cin >> d >> h >> v >> e;     double ans = 3.14159265359 * d * d * h / (4 * v - 3.14159265359 * d * d * e);     if (ans < 0)       cout <<  NO             <<   n ;     else {       cout.precision(17);       cout <<  YES             <<   n             << ans <<   n ;     }   }
#include <bits/stdc++.h>   const int INF = 0x3f3f3f3f;   const int maxn = 1e5 + 50;   const int Mod = 1e6 + 3;   using namespace std;   const char YES[] =  YES , NO[] =  NO ;   int n;   int s[maxn];   bool find(int &st) {     st = n - 2;     if (st <= 0) return false;     while (st > 0 && s[st] != 0) st--;     return st > 0;   }   void solve() {     if (s[n] == 1) {       puts(NO);       return;     }     if (n == 1 || s[n - 1] == 1) {       puts(YES);       for (int i = 1; i < n + 1; i++) {         if (i == 1)           printf( %d , s[i]);         else           printf( ->%d , s[i]);       }       puts(  );       return;     }     int pos;     if (!find(pos)) {       puts(NO);       return;     }     puts(YES);     for (int i = 1; i < pos; i++) {       if (i == 1)         printf( %d , s[i]);       else         printf( ->%d , s[i]);     }     for (int i = pos; i < n + 1; i++) {       if (i == n)         printf( ))->%d , s[i]);       else if (i == pos || i == pos + 1) {         if (i == pos && pos == 1)           printf( (%d , s[i]);         else           printf( ->(%d , s[i]);       } else         printf( ->%d , s[i]);     }     puts(  );   }   int main() {     while (scanf( %d , &n) != EOF) {       for (int i = 1; i < n + 1; i++) {         scanf( %d , s + i);       }       solve();     }     return 0;   }