malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-8;   const int INF = (1 << 30) - 1;   long long Gcd(long long a, long long b) {     while (a > 0 && b > 0) {       if (a > b)         a %= b;       else         b %= a;     }     return a + b;   }   long long x, y;   int main() {     cin >> x >> y;     if (Gcd(x, y) != 1) {       printf( Impossible n );       return 0;     }     vector<char> ans;     while (x > 0 && y > 0) {       if (x > y) {         long long k = x / y;         x %= y;         if (x == 0) k--;         vector<char> g;         while (k) {           g.push_back(k % 10 +  0 );           k /= 10;         }         for (int i = g.size() - 1; i >= 0; --i) ans.push_back(g[i]);         ans.push_back( A );       } else {         long long k = y / x;         y %= x;         if (y == 0) k--;         vector<char> g;         while (k) {           g.push_back(k % 10 +  0 );           k /= 10;         }         for (int i = g.size() - 1; i >= 0; --i) ans.push_back(g[i]);         ans.push_back( B );       }     }     for (int i = 0; i < ans.size(); ++i) printf( %c , ans[i]);     puts(  );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long read() {     char ch;     for (ch = getchar(); ch <  0  || ch >  9 ; ch = getchar())       ;     long long x = ch -  0 ;     for (ch = getchar(); ch >=  0  && ch <=  9 ; ch = getchar())       x = x * 10 + ch -  0 ;     return x;   }   const int N = 2 * 1e5 + 5;   struct node {     long long j, k;     node(long long _j = 0, long long _k = 0) {       j = _j;       k = _k;     }     friend bool operator<(node x, node y) {       return x.j > y.j || x.j == y.j && x.k > y.k;     }   };   set<node> f;   long long a[N];   int main() {     int n = read();     for (int i = 1; i <= n; i++) a[i] = read();     f.insert(node(a[1] - 1, 0));     for (int i = 1; i <= n - 1; i++) {       long long m = a[i + 1], Mx = 0;       bool pty = 0;       while (1) {         set<node>::iterator pos = f.begin();         long long j = (*pos).j, k = (*pos).k;         if (j < m) break;         pty = 1;         Mx = max(Mx, k + (long long)i * ((j + 1) / m * m - m));         f.insert(node(j % m, k + (long long)i * (j - j % m)));         f.erase(pos);       }       if (pty) f.insert(node(m - 1, Mx));     }     long long ans = 0;     for (set<node>::iterator pos = f.begin(); pos != f.end(); pos++) {       long long j = (*pos).j, k = (*pos).k;       ans = max(ans, k + (long long)j * n);     }     printf( %I64d n , ans);   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 10, inf = 1e9 + 10, P = 53, MOD = 1e9 + 7;   vector<int> a, b;   int main() {     ios_base::sync_with_stdio(false);     long long n, x, t = 0;     long long ans = 1;     cin >> n >> x;     for (int i = 0; i < 42; i++)       if ((1ll << i) & x) {         ans *= 2;         n -= (1ll << i);         t++;       }     if (n < 0 || (n == 0 && t == 1)) {       cout << 0;       return 0;     }     if (n == 0) {       cout << ans - 2;       return 0;     }     for (int i = 0; i < 42; i++)       if (!((1ll << i) & x))         if ((1ll << (i + 1)) & n) n -= (1ll << (i + 1));     if (n == 0)       cout << ans;     else       cout << 0;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 110000;   const int M = 1100000;   const long long mod = 1e9 + 7;   const int inf = (int)1e9;   const double eps = 1e-9;   long long n, k, a[N];   long long f[N], inv[N], fac[N], sinv[N], g[N];   long long pw[N];   long long pow_mod(long long a, long long e) {     long long res = 1;     for (; e; a = a * a % mod, e >>= 1)       if (e & 1) res = res * a % mod;     return res;   }   long long num;   long long C(int n, int m) {     long long res = fac[n] * sinv[m] % mod;     res = res * sinv[n - m] % mod;     return res;   }   map<int, int> S;   long long cal(int i) {     if (g[i] != -1) return g[i];     long long fm = pow_mod(pow_mod(k, num), mod - 2);     long long res = 0;     for (int j = 0; j <= num; j++) {       long long tmp = C(num, j) * f[i + j] % mod;       res = (res + tmp * pw[num - j]) % mod;     }     res = res * fm % mod;     g[i] = res;     return g[i];   }   int main() {     cin.sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     cin >> n >> k;     for (int i = 1; i <= n; i++) {       cin >> a[i];       if (a[i] == -1)         num++;       else         S[a[i]]++;     }     inv[0] = inv[1] = 1;     for (int i = 2; i <= n; i++) inv[i] = pow_mod(i, mod - 2);     fac[0] = 1;     for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * (long long)i) % mod;     sinv[0] = 1;     for (int i = 1; i <= n; i++) sinv[i] = (sinv[i - 1] * inv[i]) % mod;     f[0] = 0, f[1] = 0;     for (int i = 2; i <= n; i++) {       long long a = i - 1;       long long tmp1 = (k - 1) * a + n - a;       tmp1 %= mod;       tmp1 = tmp1 * f[i - 1] % mod;       long long tmp2 = (k - 1) * a % mod;       tmp2 %= mod;       tmp2 = tmp2 * f[i - 2] % mod;       long long tmp3 = a * k % mod;       long long tmp = (tmp1 - tmp2 - tmp3 + mod + mod) % mod;       f[i] = tmp * inv[n - a] % mod;     }     pw[0] = 1;     for (int i = 1; i <= n; i++) pw[i] = (pw[i - 1] * (k - 1)) % mod;     memset(g, -1, sizeof(g));     long long ans = 0;     for (auto p : S) {       int val = p.second;       ans = (ans + cal(val)) % mod;     }     ans = (ans + (k - S.size()) * cal(0)) % mod;     cout << (ans - f[n] + mod) % mod <<   n ;     return 0;   }
#include <bits/stdc++.h>   int main() {     int ara[5001], i, n, mx = 0, j, ans[5001] = {0}, col[5001] = {0}, eq, k;     scanf( %d , &n);     for (i = 1; i <= n; i++) scanf( %d , &ara[i]);     for (i = 1; i <= n; i++) {       for (k = 1; k <= n; k++) col[k] = 0;       mx = 0, eq = 0;       for (j = i; j <= n; j++) {         col[ara[j]]++;         if (col[ara[j]] > mx || (col[ara[j]] == mx && ara[j] < eq)) {           mx = col[ara[j]];           eq = ara[j];         }         ans[eq]++;       }     }     for (i = 1; i <= n; i++) printf( %d  , ans[i]);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     int n, m;     cin >> n >> m;     vector<vector<int>> pr(n);     vector<vector<int>> nx(n);     vector<int> a(m);     long long tot = 0;     for (int i = 0; i < m; i++) {       cin >> a[i];       a[i]--;       if (i) {         tot += labs(a[i] - a[i - 1]);         pr[a[i]].push_back(a[i - 1]);         nx[a[i - 1]].push_back(a[i]);       } else {         pr[a[i]].push_back(a[i]);       }     }     nx[a[m - 1]].push_back(a[m - 1]);     long long res = tot;     for (int x = 0; x < n; x++) {       if (!pr[x].size()) continue;       long long was = 0;       for (int i = 0; i < pr[x].size(); i++)         was += labs(x - pr[x][i]) + labs(x - nx[x][i]);       vector<int> v;       for (int i = 0; i < pr[x].size(); i++) {         if (pr[x][i] != x) v.push_back(pr[x][i]);         if (nx[x][i] != x) v.push_back(nx[x][i]);       }       sort(v.rbegin(), v.rend());       long long now = 0;       for (int i = 0; i < v.size(); i++) now += v[0] - v[i];       long long best = now;       for (int i = 1; i < v.size(); i++) {         now += i * (v[i - 1] - v[i]);         now -= ((int)v.size() - i) * (v[i - 1] - v[i]);         best = min(best, now);       }       res = min(res, tot - was + best);     }     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class X, class Y>   bool minimize(X &x, const Y &y) {     X eps = 1e-9;     if (x > y + eps) {       x = y;       return true;     } else       return false;   }   template <class X, class Y>   bool maximize(X &x, const Y &y) {     X eps = 1e-9;     if (x + eps < y) {       x = y;       return true;     } else       return false;   }   template <class T>   T Abs(const T &x) {     return (x < 0 ? -x : x);   }   const int MOD = (int)1e9 + 7;   int numRow, numCol;   char board[2020][2020];   int range[2020][2020][2], limit[2020][2020][2];   int numWay[2020][2020][2], sumRow[2020][2020][2], sumCol[2020][2020][2];   void init(void) {     scanf( %d%d , &numRow, &numCol);     for (int i = (1), _b = (numRow); i <= _b; i++) scanf( %s , board[i] + 1);     if (board[1][1] ==  R  || board[numRow][numCol] ==  R ) {       cout << 0 << endl;       exit(EXIT_SUCCESS);     }     if (numRow == 1 && numCol == 1) {       cout << 1 << endl;       exit(EXIT_SUCCESS);     }   }   void add(int &x, const int &y) {     x += y;     if (x >= MOD) x -= MOD;   }   int sum(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }   int diff(int x, int y) { return x < y ? x - y + MOD : x - y; }   void optimize(void) {     for (int i = (1), _b = (numRow); i <= _b; i++) {       int cntRock = 0;       for (int j = (numCol), _a = (1); j >= _a; j--) {         range[i][j][1] = numCol - cntRock;         if (board[i][j] ==  R ) cntRock++;       }       int k = numCol;       for (int j = (numCol), _a = (1); j >= _a; j--) {         while (k >= 1 && range[i][k][1] >= j) k--;         k++;         limit[i][j][1] = k;       }     }     for (int j = (1), _b = (numCol); j <= _b; j++) {       int cntRock = 0;       for (int i = (numRow), _a = (1); i >= _a; i--) {         range[i][j][0] = numRow - cntRock;         if (board[i][j] ==  R ) cntRock++;       }       int k = numRow;       for (int i = (numRow), _a = (1); i >= _a; i--) {         while (k >= 1 && range[k][j][0] >= i) k--;         k++;         limit[i][j][0] = k;       }     }     for (int i = (2), _b = (numRow); i <= _b; i++) {       if (i <= range[1][1][0]) numWay[i][1][0] = 1;       sumCol[i][1][0] = sum(sumCol[i - 1][1][0], numWay[i][1][0]);       sumRow[i][1][0] = numWay[i][1][0];     }     for (int j = (2), _b = (numCol); j <= _b; j++) {       if (j <= range[1][1][1]) numWay[1][j][1] = 1;       sumRow[1][j][1] = sum(sumRow[1][j - 1][1], numWay[1][j][1]);       sumCol[1][j][1] = numWay[1][j][1];     }     for (int i = (2), _b = (numRow); i <= _b; i++)       for (int j = (2), _b = (numCol); j <= _b; j++) {         int k = limit[i][j][1];         numWay[i][j][1] = diff(sumRow[i][j - 1][0], sumRow[i][k - 1][0]);         k = limit[i][j][0];         numWay[i][j][0] = diff(sumCol[i - 1][j][1], sumCol[k - 1][j][1]);         for (int k = 0, _n = (2); k < _n; k++) {           sumRow[i][j][k] = sum(sumRow[i][j - 1][k], numWay[i][j][k]);           sumCol[i][j][k] = sum(sumCol[i - 1][j][k], numWay[i][j][k]);         }       }     printf( %d n , sum(numWay[numRow][numCol][1], numWay[numRow][numCol][0]));   }   int main(void) {     init();     optimize();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   int main() {     ll t;     cin >> t;     while (t--) {       int n, m;       cin >> n >> m;       int ar[n];       int su = 0;       for (int i = 0; i < n; i++) {         cin >> ar[i];         su += ar[i];       }       int ans = min(su, m);       cout << ans <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   const long long int INF = 1e12;   int n, k;   int memo[101][101][101];   int solve(string &str, int i, int N, int _max) {     _max = max(N, _max);     int &a = memo[i][N][_max];     if (a != -1) return a;     if (i == n) {       if (_max == k) return a = 1;       return a = 0;     }     if (str[i] ==  Y )       return a = solve(str, i + 1, 0, _max);     else if (str[i] ==  N )       return a = solve(str, i + 1, N + 1, _max);     else {       if (solve(str, i + 1, 0, _max)) return a = 1;       return a = solve(str, i + 1, N + 1, _max);     }     return a = 0;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     memset(memo, -1, sizeof(memo));     cin >> n >> k;     string str;     cin >> str;     if (solve(str, 0, 0, 0))       cout <<  YES ;     else       cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int type, pos, len, start[100020], dest[100020], a[100020], b[100020], q, n,       seg[4 * 100020];   bool mark[4 * 100020];   void setVal(int v, int vl, int vr, int val, int l, int r) {     if (l <= vl && vr <= r) {       seg[v] = max(seg[v], val);       mark[v] = true;       return;     }     if (r < vl || l > vr || vl == vr) return;     if (mark[v]) {       mark[v] = false;       mark[2 * v] = mark[2 * v + 1] = true;       seg[2 * v] = max(seg[2 * v], seg[v]);       seg[2 * v + 1] = max(seg[2 * v + 1], seg[v]);     }     int mid = (vl + vr) / 2;     setVal(2 * v, vl, mid, val, l, r);     setVal(2 * v + 1, mid + 1, vr, val, l, r);     seg[v] = max(seg[2 * v], seg[2 * v + 1]);   }   int getVal(int v, int vl, int vr, int p) {     int mid = (vl + vr) / 2;     if (vl == vr) return seg[v];     if (mark[v]) {       mark[v] = false;       mark[2 * v] = mark[2 * v + 1] = true;       seg[2 * v] = max(seg[2 * v], seg[v]);       seg[2 * v + 1] = max(seg[2 * v + 1], seg[v]);     }     if (p <= mid)       return getVal(2 * v, vl, mid, p);     else       return getVal(2 * v + 1, mid + 1, vr, p);   }   int main() {     scanf( %d %d , &n, &q);     for (__typeof(n) i = (1); i <= (n); i++) scanf( %d , &b[i]);     for (__typeof(n) i = (1); i <= (n); i++) scanf( %d , &a[i]);     for (__typeof(q) i = (1); i <= (q); i++) {       scanf( %d , &type);       if (type == 2) {         scanf( %d , &pos);         int idx = getVal(1, 1, n, pos);         if (idx == 0)           printf( %d n , a[pos]);         else           printf( %d n , b[start[idx] + pos - dest[idx]]);       } else {         scanf( %d %d %d , &start[i], &dest[i], &len);         setVal(1, 1, n, i, dest[i], dest[i] + len - 1);       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int y, b, r, ans = 0;     cin >> y >> b >> r;     if (y + 1 <= b && y + 2 <= r) {       ans = max(ans, 3 * y + 3);     }     if (b + 1 <= r && b - 1 <= y) {       ans = max(ans, 3 * b);     }     if (r - 1 <= b && r - 2 <= y) {       ans = max(ans, 3 * r - 3);     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline void umin(T &a, T b) {     a = min(a, b);   }   template <class T>   inline void umax(T &a, T b) {     a = max(a, b);   }   const int INF = 0x3f3f3f3f;   long long mod = 1e9 + 7;   const int N = 100005;   char s[N];   struct Trie {     static const int maxnode = 100005;     static const int sigma_size = 26;     int ch[maxnode][sigma_size];     int val[maxnode];     int p[maxnode];     int d[maxnode], ms[maxnode];     priority_queue<int> q[maxnode];     int sz;     void clear() {       sz = 1;       memset(ch[0], 0, sizeof(ch[0]));     }     int idx(char c) { return c -  a ; }     void insert(const char *s, int v) {       int u = 0, n = strlen(s);       for (int i = 0; i < n; i++) {         int c = idx(s[i]);         if (!ch[u][c]) {           memset(ch[sz], 0, sizeof(ch[sz]));           val[sz] = 0;           ch[u][c] = sz++;           d[ch[u][c]] = d[u] + 1;         }         p[ch[u][c]] = u;         u = ch[u][c];       }       val[u] = v;     }     void dfs(int u) {       for (int i = 0; i < 26; i++) {         int v = ch[u][i];         if (v) {           dfs(v);           while (!q[v].empty()) {             q[u].push(q[v].top());             q[v].pop();           }         }       }       if (u == 0) return;       if (val[u] == 0) {         q[u].pop();         q[u].push(d[u]);       } else {         q[u].push(d[u]);       }     }     int solve() {       dfs(0);       int ans = 0;       while (!q[0].empty()) {         ans += q[0].top();         q[0].pop();       }       return ans;     }   } wc;   int main() {     int n;     scanf( %d , &n);     wc.clear();     for (int i = 0; i < n; i++) {       scanf( %s , s);       wc.insert(s, 1);     }     printf( %d n , wc.solve());     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = 0x3f3f3f3f;   const int idata = 2e5 + 7;   int i, j, k;   int judge, flag;   long long step[idata];   long long temp;   int n, m, t;   double maxx = 0, minn = inf;   long long cnt, len, sum, ans;   long long high, wigh;   map<long long, int> pre[2];   signed main() {     while (cin >> n >> k) {       memset(step, 0, sizeof step);       for (i = 1; i <= n; i++) {         cin >> step[i];         pre[0][step[i]]++;       }       for (i = 1; i <= n; i++) {         pre[0][step[i]]--;         if (step[i] % k == 0) {           ans += (long long)pre[1][step[i] / k] * pre[0][step[i] * k];         }         pre[1][step[i]]++;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1000005;   int n;   int a[MAXN];   int x[MAXN];   int y[MAXN];   int match[MAXN];   bool vis[MAXN];   int main() {     ios::sync_with_stdio(0);     cin >> n;     if (~n & 1) {       cout <<  First  << endl;       for (int i = 1; i <= n; i++) cout << i <<    ;       for (int i = 1; i <= n; i++) cout << i <<    ;       cout << endl;       cout.flush();       return 0;     } else {       cout <<  Second  << endl;       for (int i = 1; i <= 2 * n; i++) {         cin >> a[i];         if (x[a[i]])           y[a[i]] = i;         else           x[a[i]] = i;       }       for (int i = 1; i <= n; i++) {         match[x[i]] = y[i];         match[y[i]] = x[i];       }       for (int i = 1; i <= n; i++) {         int cur = i;         if (vis[i] || vis[i + n]) continue;         while (!vis[cur]) {           vis[cur] = 1;           cur = (match[cur] > n ? match[cur] - n : match[cur] + n);         }       }       int sum = 0;       for (int i = 1; i <= 2 * n; i++)         if (vis[i]) (sum += i) %= (2 * n);       if (sum) {         for (int i = 1; i <= 2 * n; i++) vis[i] ^= 1;       }       for (int i = 1; i <= 2 * n; i++)         if (vis[i]) cout << i <<    ;       cout << endl;       cout.flush();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int n, m, x, y, i, j, k, l;     cin >> n >> m >> x >> y;     cout << x <<     << y <<   n ;     for (i = 1; i <= m; i++)       if (i != y) cout << x <<     << i <<   n ;     int c;     for (i = 1, j = m; i <= n; i++)       if (i != x)         for (k = 1; k <= m; k++) {           cout << i <<     << j <<   n ;           if (j == m)             c = -1;           else if (j == 1)             c = 1;           if (k != m) j += c;         }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   set<int> s;   const int MAX = 150000;   int t[MAX];   int main() {     int n, q, k;     cin >> n >> k >> q;     for (int i = 0; i < n; i++) scanf( %d , t + i);     for (int i = 0; i < q; i++) {       int query;       scanf( %d , &query);       int x;       scanf( %d , &x);       x = t[x - 1];       if (query == 1) {         if (s.size() == k) {           set<int>::iterator it = s.begin();           if (x > *it) {             s.erase(*it);             s.insert(x);           }         } else {           s.insert(x);         }       } else {         if (s.count(x))           printf( YES n );         else           printf( NO n );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   pair<int, int> v[110];   int cur[110];   int main() {     int n, w;     scanf( %d %d , &n, &w);     for (int i = 0; i < n; ++i) {       scanf( %d , &v[i].first);       v[i].second = i;     }     sort(v, v + n);     reverse(v, v + n);     for (int i = 0; i < n; ++i) {       w -= (v[i].first + 1) / 2;       if (w < 0) return puts( -1 ), 0;       cur[i] = (v[i].first + 1) / 2;     }     for (int i = 0; i < n - 1; ++i) {       if (cur[i] < cur[i + 1]) {         int dif = cur[i + 1] - cur[i];         if (cur[i] == cur[i + 1]) dif++;         if (w >= dif) {           cur[i] += dif;           w -= dif;         } else if (cur[i + 1] >= dif) {           cur[i + 1] -= dif;           cur[i] += dif;         } else           return puts( -1 );       }     }     for (int i = 0; i < n; ++i) {       if (w) {         int dif = v[i].first - cur[i];         if (w >= dif) {           cur[i] += dif;           w -= dif;         } else if (dif >= w) {           cur[i] += w;           w = 0;         }       } else         break;     }     for (int i = 0; i < n; ++i) v[v[i].second].first = cur[i];     for (int i = 0; i < n; ++i) printf( %d  , v[i].first);     puts(  );     return 0;   }
//#pragma GCC optimize( Ofast )      #include <iostream>   #include <vector>   #include <map>   #include <algorithm>   #include <random>   #include <chrono>   #include <complex>   #include <cstdio>   #include <deque>   #include <cmath>   #include <bitset>   #include <set>   #include <cassert>      using namespace std;      #define ll long long   #define ull unsigned long long   #define pb push_back   #define se second   #define fi first   #define forn(i,n) for(int i = 0; i < (n); i++)   #define read(a) for(int i = 0; i < a.size(); i++){cin >> a[i];}   #define all(a) a.begin(),a.end()   #define make_unique(a) sort(all(a)); a.resize(unique(a.begin(),a.end())-a.begin());   const int mod = 1e9 + 7;   //#define int long long      const int N = 10000000;   int lp[N+1];   vector<int> pr;      void solve(){       int t;       cin >> t;          for (int i=2; i<=N; ++i) {           if (lp[i] == 0) {               lp[i] = i;               pr.push_back (i);           }           for (int j=0; j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=N; ++j)               lp[i * pr[j]] = pr[j];       }          set<vector<int>> se;          while(t--){           int n,k;           cin >> n >> k;           vector<int> a(n);           read(a);           ll ans = 1;           se.clear();           for(int i = 0; i < n; ++i){               vector<int> qw;               int nw = a[i];               while(nw != 1){                   if(!qw.empty() && qw.back() == lp[nw]){                       qw.pop_back();                       nw /= lp[nw];                       continue;                   }                   if(qw.empty() || qw.back() != lp[nw]){                       qw.push_back(lp[nw]);                   }                   nw /= lp[nw];                                  }               if(se.count(qw)){                   ans++;                   se.clear();               }               se.insert(qw);           }           cout << ans <<   n ;       }      }            signed main() {       ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);   #ifdef Debugg       freopen( ain.txt , r ,stdin);       freopen( aout.txt , w ,stdout);   #endif       solve();   #ifdef Debugg       cout <<   n  << (double)clock()/CLOCKS_PER_SEC;   #endif   }