malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using ll = long long;   using ld = long double;   const ld PI = 4 * atanl(1);   const ld EPS = 1e-12;   const int MN = 1e5 + 10;   struct vec {    public:     int x, y;     void in() { scanf( %d%d , &x, &y); }     ld mag() const { return hypotl(x, y); }     ld ang() const { return atan2l(y, x); }   };   struct Evt {    public:     ld t;     int v;     Evt(ld _t = 0, int _v = 0) : t(_t), v(_v) {}     bool operator<(const Evt& o) const { return t < o.t; }   };   struct BIT {    public:     int a[MN * 2], L;     void reset(int _L) {       memset(a, 0, L * sizeof *a);       L = _L;     }     void upd(int n, int v) {       for (++n; n <= L; n += -n & n) a[n - 1] += v;     }     int qry(int n) {       int f = 0;       for (; n; n -= -n & n) f += a[n - 1];       return f;     }     int qry(int l, int r) { return qry(r) - qry(l); }   };   int N, p[MN];   ll K;   vec a[MN];   std::vector<Evt> evt;   BIT bit;   ll count(ld d) {     ll f = (ll)N * (N - 1) / 2;     int ctr = 0;     for (int i = 0; i < N; ++i)       if (d < a[i].mag()) {         ld m = a[i].ang();         ld dif = acosl(d / a[i].mag());         ld s = m - dif, e = m + dif;         if (s + EPS < 0) s += 2 * PI, e += 2 * PI;         if (2 * PI < e + EPS) e -= 2 * PI;         if (e < s) std::swap(s, e);         evt.push_back({s, ctr});         evt.push_back({e, ctr});         ctr++;       }     std::sort(evt.begin(), evt.end());     memset(p, -1, ctr * sizeof *p);     bit.reset(ctr * 2);     for (int i = 0; i < evt.size(); ++i) {       int v = evt[i].v;       if (~p[v])         bit.upd(p[v], -1), f -= bit.qry(p[v] + 1, i);       else         p[v] = i, bit.upd(i, 1);     }     evt.clear();     return f;   }   int main() {     scanf( %d%lld , &N, &K);     for (int i = 0; i < N; ++i) a[i].in();     ld l = -logl(1e8), r = logl(2e4), m;     for (int i = 0; i < 100; ++i) {       ld m = (r + l) / 2;       if (count(exp(m)) < K)         l = m;       else         r = m;     }     printf( %.9lf n , (double)exp(r));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, tot, a[1001000], ans[1001000 << 2], k[1001000];   long long s;   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= m; i++) scanf( %d , &a[i]), s += a[i], k[i] = s % n;     k[m] = n;     sort(k + 1, k + m + 1);     for (int i = m; i; i--) k[i] -= k[i - 1];     for (int i = 1, j = 1; i <= m; ++i) {       int x = a[i];       while (x > 0) ans[++tot] = i, x -= k[j], j = j % m + 1;     }     while (tot % m) ans[++tot] = 1;     printf( %d n , tot / m);     for (int i = 1; i <= m; ++i) printf( %d  , k[i]);     puts(  );     for (int i = 1; i <= tot; ++i) {       printf( %d , ans[i]);       putchar(i % m ?     :   n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b, c;     cin >> a >> b >> c;     int count = 0;     int min = a;     if (b < a) {       min = b;     }     int x = c / min;     for (int i = 0; i <= x; i++) {       for (int j = 0; j <= x; j++) {         if (count != 0) {           break;         }         if (a * i + b * j == c) {           count++;           cout <<  Yes ;         }       }     }     if (count == 0) {       cout <<  No ;     }   }
#include <bits/stdc++.h>   using namespace std;   void PT(long long a);   void PT1(long long a);   const long long M = 2 * (1e5) + 7;   long long a[M];   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     {       long long n, k;       cin >> n >> k;       if (k * (k - 1) < n)         return cout <<  NO                      <<   n ,                0;       cout <<  YES             <<   n ;       vector<pair<long long, long long>> v;       long long i = 1, j = 2;       while (v.size() < n) {         if (v.size() == 0) {           v.push_back({i, j});           v.push_back({j, i});         } else if ((v.back()).first == i || (v.back()).second == j) {           v.push_back({j, i});           v.push_back({i, j});         } else {           v.push_back({i, j});           v.push_back({j, i});         }         if (j == k) {           i++;           j = i + 1;         } else           j++;       }       for (long long i = 0; i < n; i++) {         cout << v[i].first <<     << v[i].second <<   n ;       }     }     return 0;   }   void PT(long long a) { cout << a <<   n ; }   void PT1(long long a) { cout << a <<    ; }
#include <bits/stdc++.h>   using namespace std;   struct Edge {     int u, v;   } e[200050 << 1];   int fa[200050];   int n, color[200050], s, d;   int cnt[2], dis[200050];   bool vis[200050];   vector<int> G[200050];   int find(int x) {     if (x == fa[x]) return x;     return fa[x] = find(fa[x]);   }   void _union(int x, int y) {     int f1 = find(x);     int f2 = find(y);     if (f1 == f2) return;     if (f1 < f2)       fa[f2] = f1;     else       fa[f1] = f2;   }   queue<int> q;   void bfs(int u) {     memset(vis, false, sizeof(vis));     memset(dis, 0, sizeof(dis));     while (!q.empty()) q.pop();     q.push(u);     vis[u] = true;     while (!q.empty()) {       int now = q.front();       q.pop();       for (int i = 0; i < G[now].size(); i++) {         int v = G[now][i];         if (!vis[v]) {           q.push(v);           vis[v] = true;           s = v;           dis[v] = dis[now] + 1;         }       }     }   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &color[i]);       fa[i] = i;     }     for (int i = 1; i < n; i++) {       int u, v;       scanf( %d%d , &u, &v);       e[2 * i - 1].u = u;       e[2 * i - 1].v = v;       e[i * 2].u = v;       e[i * 2].v = u;       if (color[u] == color[v]) _union(u, v);     }     for (int i = 1; i <= n; i++) fa[i] = find(i);     for (int i = 1; i < n; i++) {       int u = e[i * 2 - 1].u, v = e[i * 2 - 1].v;       if (fa[u] != fa[v]) {         G[fa[u]].push_back(fa[v]);         G[fa[v]].push_back(fa[u]);       }     }     int i = 1;     for (; G[i].size() == 0 && i <= n; i++)       ;     if (i > n) {       printf( 0 n );       return 0;     }     bfs(i);     bfs(s);     printf( %d n , (dis[s] + 1) / 2);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, k;   vector<int> g[100010];   const int inf = 1e9;   int d[100010], p[100010];   queue<int> Q;   void bfs(int x) {     for (int i = 1; i <= n; i++) d[i] = inf;     d[x] = 0;     while (!Q.empty()) Q.pop();     Q.push(x);     while (!Q.empty()) {       int y = Q.front();       Q.pop();       for (int z : g[y]) {         if (d[z] < inf) continue;         d[z] = d[y] + 1;         p[z] = y;         Q.push(z);       }     }   }   bool dfs(int x, int pa, int c) {     int d = g[x].size();     if (pa) d--;     if (c) {       if (d < 3) return 0;     } else {       if (d) return 0;     }     for (int y : g[x]) {       if (y == pa) continue;       if (!dfs(y, x, c - 1)) return 0;     }     return 1;   }   int main() {     cin >> n >> k;     for (int i = 1, x, y; i < n; i++) {       scanf( %d%d , &x, &y);       g[x].push_back(y);       g[y].push_back(x);     }     bfs(1);     int x = max_element(d + 1, d + n + 1) - d;     bfs(x);     int y = max_element(d + 1, d + n + 1) - d;     int l = d[y];     while (2 * d[y] > l) y = p[y];     puts(dfs(y, 0, k) ?  Yes  :  No );   }
#include <bits/stdc++.h>   using namespace std;   void code() {     long long n, k;     cin >> n >> k;     long long a[n];     for (long long i = 0; i < n; i++) {       cin >> a[i];     }     sort(a, a + n);     long long ans = 0;     for (long long i = 0; i < n; i++) {       if ((a[i] - a[0]) % k != 0) {         cout <<  -1  << endl;         return;       }       ans += ((a[i] - a[0]) / k);     }     cout << ans << endl;   }   signed main() { code(); }
#include <bits/stdc++.h>   using namespace std;   template <class T1, class T2>   istream &operator>>(istream &in, pair<T1, T2> &P) {     in >> P.first >> P.second;     return in;   }   template <class T1, class T2>   ostream &operator<<(ostream &out, const pair<T1, T2> &P) {     out <<  (  << P.first <<  ,   << P.second <<  ) ;     return out;   }   template <class T>   istream &operator>>(istream &in, vector<T> &arr) {     for (auto &x : arr) in >> x;     return in;   }   template <class T>   ostream &operator<<(ostream &out, const vector<T> &arr) {     for (auto &x : arr) out << x <<    ;     cout <<   n ;     return out;   }   template <class T>   istream &operator>>(istream &in, deque<T> &arr) {     for (auto &x : arr) in >> x;     return in;   }   template <class T>   ostream &operator<<(ostream &out, const deque<T> &arr) {     for (auto &x : arr) out << x <<    ;     cout <<   n ;     return out;   }   int f(int x, int y) {     if (x % y == 0) {       return f(x / y, y);     }     return x;   }   int n, k;   int32_t main() {     mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());     int u = 900000;     cin >> n >> k;     vector<int> v(n);     cin >> v;     vector<int> stv = v;     while (u--) {       vector<pair<int, int> > op;       stv = v;       while (v.size() > 1) {         shuffle(v.begin(), v.end(), rng);         pair<int, int> nv;         nv.first = v.back();         int second = v.back();         v.pop_back();         nv.second = v.back();         second += v.back();         v.pop_back();         op.push_back(nv);         v.push_back(f(second, k));       }       if (v[0] == 1) {         cout <<  YES  << endl;         for (auto w : op) {           cout << w.first <<     << w.second << endl;         }         return 0;       }       v = stv;     }     cout <<  NO  << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     long double tp, temp, temp2, div;     vector<long double> v;     map<long double, long long int> mp;     string in;     double storage;     cin >> t;     while (t--) {       cin >> in;       storage = 0;       temp = -1;       temp2 = -1;       for (int a1 = 0; a1 < in.size(); a1++) {         if (isdigit(in[a1])) {           storage *= 10;           storage += in[a1] -  0 ;         } else {           if (storage != 0) {             if (temp == -1) {               temp = storage;               storage = 0;               continue;             } else if (temp2 == -1) {               temp2 = storage;               storage = 0;               continue;             }           }         }       }       div = storage;       tp = (temp + temp2) / div;       v.push_back(tp);       mp[tp]++;     }     for (int a1 = 0; a1 < v.size(); a1++) {       if (a1 != v.size() - 1)         cout << mp[v[a1]] <<    ;       else         cout << mp[v[a1]] << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<string, string>>::iterator findit(       vector<pair<string, string>>::iterator st,       vector<pair<string, string>>::iterator en, string s) {     while (st != en) {       if ((*st).second == s) {         return st;       } else {         ++st;       }     }     return en;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int q;     cin >> q;     string old, newi;     long long int i;     vector<pair<string, string>> v;     long long int count = 0;     for (i = 0; i < q; ++i) {       cin >> old >> newi;       vector<pair<string, string>>::iterator it = findit(v.begin(), v.end(), old);       if (it == v.end()) {         v.push_back(make_pair(old, newi));         count++;       } else {         (*it).second = newi;       }     }     cout << count <<   n ;     for (i = 0; i < count; ++i) {       cout << v[i].first <<     << v[i].second <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<int> arr(n);     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     int last = 0;     int ans = 0;     string s =   ;     int l = 0, r = n - 1;     while (1) {       int k = INT_MAX;       if (arr[l] > last) {         k = arr[l];       }       if (arr[r] > last) {         k = min(k, arr[r]);       }       if (k != arr[l] && k != arr[r]) {         break;       }       ans++;       last = k;       if (k == arr[r] && k == arr[l]) {         int c1 = 0, c2 = 0;         for (int i = l + 1; i < r; i++) {           if (arr[i] > arr[i - 1]) {             c1++;           } else {             break;           }         }         c1++;         c2++;         for (int i = r - 1; i > l; i--) {           if (arr[i] > arr[i + 1]) {             c2++;           } else {             break;           }         }         ans += max(c1, c2);         cout << ans - 1 << endl;         cout << s;         if (c1 >= c2) {           for (int i = 0; i < c1; i++) {             cout <<  L ;           }         } else {           for (int i = 0; i < c2; i++) {             cout <<  R ;           }         }         return 0;       } else if (k == arr[r]) {         r--;         s +=  R ;       } else {         l++;         s +=  L ;       }       if (l > r) {         break;       }     }     cout << ans << endl;     cout << s;   }
#include <bits/stdc++.h>   using namespace std;   const long long int N = 1001;   long long int n, m, k;   vector<pair<long long int, long long int> > adj[N];   vector<long long int> func(long long int x) {     vector<long long int> dis(n + 1, INT_MAX);     if (x == 0) {       return dis;     }     vector<int> vis(n + 1, 0);     set<pair<long long int, long long int> > s;     s.insert(make_pair(0, x));     dis[x] = 0;     while (!s.empty()) {       long long int v = (*s.begin()).second;       s.erase(s.begin());       if (vis[v]) {         continue;       }       vis[v] = 1;       for (auto u : adj[v]) {         if (dis[u.first] > dis[v] + u.second) {           dis[u.first] = dis[v] + u.second;           s.insert(make_pair(dis[u.first], u.first));         }       }     }     return dis;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n >> m >> k;     vector<pair<pair<long long int, long long int>, long long int> > edges;     for (long long int i = 0; i < m; ++i) {       long long int a, b, w;       cin >> a >> b >> w;       adj[a].push_back(make_pair(b, w));       adj[b].push_back(make_pair(a, w));       edges.push_back(make_pair(make_pair(a, b), w));     }     vector<pair<long long int, long long int> > queries(k);     for (long long int i = 0; i < k; ++i) {       cin >> queries[i].first >> queries[i].second;     }     vector<vector<long long int> > dis;     for (long long int i = 0; i <= n; ++i) {       dis.push_back(func(i));     }     long long int ans = 0;     for (long long int i = 0; i < k; ++i) {       ans += dis[queries[i].first][queries[i].second];     }     for (long long int i = 0; i < m; ++i) {       long long int a = edges[i].first.first;       long long int b = edges[i].first.second;       long long int w = edges[i].second;       long long int cost = 0;       for (long long int j = 0; j < k; ++j) {         long long int x = queries[j].first, y = queries[j].second;         long long int price = dis[x][y];         if (dis[x][a] < dis[x][b] && dis[y][a] > dis[y][b]) {           price = min(price, dis[x][a] + dis[b][y]);         } else if (dis[x][b] < dis[x][a] && dis[y][a] < dis[y][b]) {           price = min(price, dis[x][b] + dis[y][a]);         }         cost += price;       }       ans = min(ans, cost);     }     cout << ans;     return (0);   }
#include <bits/stdc++.h>   using namespace std;   struct node {     long long x;     long long y;     long long id;   } a[200005];   long long n, t;   long long totx, toty;   inline void read(long long &x) {     long long f;     char c;     for (f = 1, c = getchar(); c <  0  || c >  9 ; c = getchar())       if (c ==  - ) f = -1;     for (x = 0; c <=  9  && c >=  0 ; c = getchar()) x = x * 10 + (c & 15);     x *= f;   }   inline bool cmp(node p, node q) { return p.y < q.y; }   int main() {     read(t);     while (t--) {       totx = toty = 0;       read(n);       for (int i = 1; i < 2 * n; i++) {         read(a[i].x);         read(a[i].y);         a[i].id = (long long)i;         totx += a[i].x;       }       sort(a + 1, a + 2 * n, cmp);       for (int i = 1; i < 2 * n; i += 2) toty += a[i].x;       puts( YES );       if (toty * 2 >= totx) {         for (int i = 1; i < 2 * n; i += 2) printf( %lld  , a[i].id);         puts(  );       } else {         for (int i = 2; i < 2 * n; i += 2) printf( %lld  , a[i].id);         printf( %lld n , a[2 * n - 1].id);       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main(int argc, char const *argv[]) {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n, m;     cin >> n >> m;     vector<vector<int> > G(n + 5, vector<int>(0));     int c[m + 5][2];     memset(c, (0), sizeof(c));     for (int i = 1; i <= m; i++) {       int l, r;       cin >> l >> r;       for (int j = l; j <= r; j++) G[j].push_back(i);     }     int ans[n + 5];     for (int i = 1; i <= n; i++) {       int rs = 0, ls = 0;       int put = 0;       for (int j = 0; j < int(G[i].size()); j++) {         int v = G[i][j];         rs += c[v][0];         ls += c[v][1];         if (rs > ls)           put = 1;         else           put = 0;       }       ans[i] = put;       for (int j = 0; j < int(G[i].size()); j++) {         int v = G[i][j];         c[v][put]++;       }     }     for (int i = 1; i <= n; i++) cout << ans[i];     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, r[20], b[20];   char ch[20];   long long dp[(1 << 16)][260];   long long dfs(int bit, int discount) {     long long& ret = dp[bit][discount];     if (ret != -1) return ret;     if (bit == (1 << n) - 1) {       return ret = 0;     }     ret = 0xffffffffffffff;     int Rcard = 0, Bcard = 0, cnt = 0;     ;     long long Rused = 0, Bused = 0;     for (int i = 0; i < n; i++) {       if (bit & (1 << i)) {         ++cnt;         Rused += r[i];         Bused += b[i];         if (ch[i] ==  R )           ++Rcard;         else           Bcard++;       }     }     int gap = discount - 120;     long long remainR = 0, remainB = 0;     if (gap > 0)       Rused -= gap;     else       Bused += gap;     if (Rused > Bused) {       remainB = Rused - Bused;     } else {       remainR = Bused - Rused;     }     for (int i = 0; i < n; i++) {       if (!(bit & (1 << i))) {         long long maxi = max((long long)(r[i] - Rcard - remainR),                              (long long)(b[i] - Bcard - remainB));         maxi = max(maxi, (long long)0);         long long discountR = min(r[i], Rcard);         long long discountB = min(b[i], Bcard);         long long go = dfs(bit | (1 << i), discount + discountR - discountB);         ret = min(ret, go + maxi);       }     }     return ret;   }   int main() {     memset(dp, -1, sizeof(dp));     scanf( %d , &n);     for (int i = 0; i < n; i++) {       cin >> ch[i];       scanf( %d %d , &r[i], &b[i]);     }     long long ans = dfs(0, 120);     ans += n;     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, i = 0, j = 0, flag = 0, hash[100002] = {0}, stack[100002] = {0},            top = -1;     string x;     char item;     getline(cin, x);     n = x.length();     for (i = 0; i < n; i++) {       if (x[i] ==  ( ) {         stack[++top] = i;       }       if (x[i] ==  ) ) {         if (top < 0) {           flag = 1;           break;         } else {           item = stack[top];           top--;         }       }       if (x[i] ==  # ) {         hash[j] = i;         j++;         if (top < 0) {           flag = 1;           break;         }       }     }     if (flag == 1 || stack[top] > hash[j - 1]) {       cout <<  -1 ;       return 0;     } else {       for (i = 0; i < j - 1; i++) {         hash[i] = 1;         item = stack[top];         top--;       }     }     if (top < 0)       cout <<  -1 ;     else {       hash[i] = top + 1;       for (i = 0; i < j; i++) {         cout << hash[i] << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long phi(long long x);   const long long mod = 1e9 + 7;   int main() {     long long N, K;     cin >> N >> K;     while (K > 0 && N > 1) {       N = phi(N);       K -= 2;     }     cout << N % mod << endl;   }   long long phi(long long x) {     int R = sqrt(x);     long long ans = 1;     for (int p = 2; p <= R; ++p) {       if (x % p == 0) {         long long curr = 1;         while (x % p == 0) {           curr *= p;           x /= p;         }         ans *= (curr - curr / p);       }     }     if (x > 1) {       ans *= (x - 1);     }     return ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t;     cin >> t;     while (t--) {       long long n;       string x;       cin >> n >> x;       string a(n,  0 ), b(n,  0 );       for (long long i = 0; i < n; ++i) {         if (x[i] ==  1 ) {           a[i] =  1 ;           b[i] =  0 ;           for (int j = i + 1; j < n; ++j) {             b[j] = x[j];           }           break;         } else {           a[i] = b[i] =  0  + (x[i] -  0 ) / 2;         }       }       cout << a << endl << b << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }   const int INF = 1 << 30;   const double eps = 1e-8;   const int row = 3000;   const int cow = 220;   const int MAXN = cow * cow;   int n, m;   long long a[50000];   long long sum[50000];   char s[5000];   int main() {     int i, j, t;     long long k;     cin >> k;     scanf( %s , &s);     n = strlen(s);     sum[0] = 0;     for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + s[i - 1] -  0 ;     memset(a, 0, sizeof(a));     for (i = 0; i <= n; i++) {       for (j = i + 1; j <= n; j++) {         a[sum[j] - sum[i]]++;       }     }     long long ans = 0;     if (k == 0) {       ans += (a[0] * a[0]);       for (i = 1; i < 50000; i++) {         ans += (a[0] * a[i] * 2);       }     } else {       for (i = 1; i <= 40000; i++) {         if (k % i == 0 && k / i <= 40000) {           ans += (a[i] * a[k / i]);         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   signed main() {     ios::sync_with_stdio(false);     cin.tie(0), cout.tie(0);     int t;     cin >> t;     while (t--) {       int n, x, y;       cin >> n >> x >> y;       vector<int> a(n);       for (auto &el : a) {         cin >> el;         el--;       }       int need = y - x;       vector<vector<int>> where(n + 1);       for (int i = 0; i < n; i++) {         where[a[i]].push_back(i);       }       int free = 0;       while (where[free].size()) {         free++;       }       set<pair<int, int>, greater<pair<int, int>>> st;       for (int i = 0; i < n + 1; i++) {         st.insert({where[i].size(), i});       }       vector<int> ans(n, free);       while (x--) {         auto [sz, x] = *st.begin();         st.erase(st.begin());         ans[where[x].back()] = x;         where[x].pop_back();         st.insert({sz - 1, x});       }       int d = st.begin()->first;       vector<pair<int, int>> poses;       while (st.size()) {         auto [sz, x] = *st.begin();         st.erase(st.begin());         while (where[x].size()) {           poses.emplace_back(where[x].back(), x);           where[x].pop_back();         }       }       for (int i = 0; i < poses.size() && need; i++) {         int j = (i + d) % poses.size();         if (poses[j].second != poses[i].second) {           need--;           ans[poses[j].first] = poses[i].second;         }       }       if (need) {         cout <<  NO n ;         continue;       }       cout <<  YES n ;       for (auto &el : ans) {         cout << el + 1 <<    ;       }       cout <<   n ;     }   }