malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   int D[61];   int main() {     int i, j, k, cnt;     for (i = 0; i <= 60; i++) {       cnt = 0;       for (j = 1, k = i; k > 0; j++, k -= j) cnt++;       D[i] = cnt;     }     int n, x, p = 0;     scanf( %d , &n);     for (i = 0; i < n; i++) {       scanf( %d , &x);       p ^= D[x];     }     printf( %s n , p == 0 ?  YES  :  NO );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool win(long long a, long long b) {     if (a > b) swap(a, b);     if (a == 0) return false;     if (!win(b % a, a)) return true;     long long df = b - b % a;     if (a % 2)       return df % 2 == 0;     else       return df / a % (a + 1) % 2 == 0;   }   void solve() {     long long a, b;     cin >> a >> b;     if (win(a, b))       cout <<  First  << endl;     else       cout <<  Second  << endl;   }   int main() {     ios_base::sync_with_stdio(0);     int T;     cin >> T;     for (int _ = 0; _ < (int)(T); _++) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, a;     cin >> n;     int hasil[101] = {0};     for (int i = 1; i <= n; i++) {       cin >> a;       if (a / 2 != 1) {         while (a % 2 != 0) {           a++;           hasil[i]++;         }       } else {         a++;         hasil[i]++;         while (a % 2 != 0) {           a++;           hasil[i]++;         }       }     }     for (int i = 1; i <= n; i++) {       cout << hasil[i] << endl;     }   }
#include <bits/stdc++.h>   const long long Inf = 1e18;   const long double eps = 1e-7;   long long LINF = (long long)2e18;   using namespace std;   long long mod = 1e9 + 7;   long long mod5 = 1e9 + 9;   long long mod3 = 998244353;   long long mod4 = 1000003;   long long mod2 = 1e9 + 123;   const int MAXN = 4000001;   const int INF = 1000000000;   int n, r;   vector<pair<int, int> > xy;   struct Tree {     vector<long long> lazy;     vector<long long> t;     Tree(int n) {       t.resize(4 * n);       lazy.resize(4 * n, 0);     }     void push(int v, int tl, int tr) {       t[v] += lazy[v];       if (tl != tr) {         lazy[2 * v] += lazy[v];         lazy[2 * v + 1] += lazy[v];       }       lazy[v] = 0;     }     void update(int v, int tl, int tr, int l, int r, int x) {       push(v, tl, tr);       if (l == tl && r == tr) {         lazy[v] += x;         push(v, tl, tr);         return;       }       int tm = (tl + tr) / 2;       if (r <= tm) {         update(2 * v, tl, tm, l, r, x);         push(2 * v + 1, tm + 1, tr);       } else if (l > tm) {         update(2 * v + 1, tm + 1, tr, l, r, x);         push(2 * v, tl, tm);       } else {         update(2 * v, tl, tm, l, tm, x);         update(2 * v + 1, tm + 1, tr, tm + 1, r, x);       }       t[v] = max(t[2 * v], t[2 * v + 1]);     }     long long mx(int v, int tl, int tr, int l, int r) {       push(v, tl, tr);       if (l == tl && r == tr) {         return t[v];       }       int tm = (tl + tr) / 2;       if (r <= tm)         return mx(2 * v, tl, tm, l, r);       else if (l > tm)         return mx(2 * v + 1, tm + 1, tr, l, r);       else {         return max(mx(2 * v, tl, tm, l, tm),                    mx(2 * v + 1, tm + 1, tr, tm + 1, r));       }     }   };   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cout.setf(ios::fixed);     cout.precision(20);     cin >> n >> r;     xy.resize(n);     int mn = 1e9;     for (int(i) = 0; (i) < n; (i)++) {       int x, y;       cin >> x >> y;       xy[i].first = x + y;       xy[i].second = x - y;       mn = min(mn, xy[i].second);     }     for (int(i) = 0; (i) < n; (i)++) {       xy[i].second -= mn;     }     sort((xy).begin(), (xy).end());     int itl = 0, itr = 0;     r *= 2;     long long ans = 0;     Tree t(MAXN);     while (itl != n) {       if (itr < n && xy[itr].first - xy[itl].first <= r) {         t.update(1, 0, MAXN - 1, max(0, xy[itr].second - r), xy[itr].second, 1);         ans = max(ans, t.mx(1, 0, MAXN - 1, 0, MAXN - 1));         itr++;       } else {         t.update(1, 0, MAXN - 1, max(0, xy[itl].second - r), xy[itl].second, -1);         itl++;       }     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long read() {     long long ans = 0;     char last =    , ch = getchar();     while (ch <  0  || ch >  9 ) last = ch, ch = getchar();     while (ch >=  0  && ch <=  9 ) ans = ans * 10 + ch -  0 , ch = getchar();     if (last ==  - ) ans = -ans;     return ans;   }   const int N = 2e5 + 5;   int n;   long long k, sum, tmp, suf[N], a[N], c, ans;   long long accCeil(long long a, long long b) {     long long res = a / b;     if (res * b < a) res++;     return res;   }   int main() {     int T = read();     while (T--) {       n = read(), k = read();       sum = 0;       for (int i = 1; i <= n; ++i) {         a[i] = read();         sum += a[i];       }       if (sum <= k) {         printf( 0 n );         continue;       }       if (n == 1) {         printf( %lld n , sum - k);         continue;       }       sort(a + 1, a + n + 1);       suf[n + 1] = 0;       ans = 1e18;       for (int i = n; i > 1; --i) {         suf[i] = suf[i + 1] + a[i];         tmp = sum - k - suf[i] + (n - i + 1) * a[1];         c = max(accCeil(tmp, n - i + 2), 0ll);         ans = min(ans, n - i + 1 + c);       }       printf( %lld n , min(ans, sum - k));     }     return 0;   }
#include <bits/stdc++.h>   int main() {     int x, y, n;     int k, i, t;     scanf( %d , &t);     for (i = 0; i < t; i++) {       scanf( %d %d %d , &x, &y, &n);       if (n - n % x + y <= n) {         k = n - n % x + y;       } else {         k = n - n % x - (x - y);       }       printf( %d n , k);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool check(string s) {     for (int i = 0; i < s.size() - 1; i++) {       if (s[i] == s[i + 1]) return false;     }     return true;   }   void solve() {     string s;     cin >> s;     for (int i = 0; i < s.size(); i++) {       if (s[i] ==  ?  && i != 0 && i != s.size() - 1) {         if (s[i - 1] ==  a  && s[i + 1] ==  c  ||             s[i - 1] ==  c  && s[i + 1] ==  a )           s[i] =  b ;         else if (s[i - 1] ==  a  && s[i + 1] ==  b  ||                  s[i - 1] ==  b  && s[i + 1] ==  a )           s[i] =  c ;         else if (s[i - 1] ==  b  && s[i + 1] ==  c  ||                  s[i - 1] ==  c  && s[i + 1] ==  b )           s[i] =  a ;         else if (s[i - 1] ==  a )           s[i] =  b ;         else if (s[i - 1] ==  b )           s[i] =  c ;         else if (s[i - 1] ==  c )           s[i] =  a ;       } else if (s[i] ==  ?  && i == 0) {         if (s[i + 1] ==  a )           s[i] =  b ;         else if (s[i + 1] ==  b )           s[i] =  c ;         else if (s[i + 1] ==  c )           s[i] =  a ;         else           s[i] =  a ;       } else if (s[i] ==  ?  && i == s.size() - 1) {         if (s[i - 1] ==  a )           s[i] =  b ;         else if (s[i - 1] ==  b )           s[i] =  c ;         else if (s[i - 1] ==  c )           s[i] =  a ;         else           s[i] =  a ;       }     }     if (check(s)) {       cout << s << endl;     } else       cout << -1 << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int t;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int a[555][555];   char ans[555];   void die() {     for (int i = 0; i < n; ++i) {       for (int j = 0; j < n; ++j) {         if (i != j) {           if (abs(ans[i] - ans[j]) <= 1 && !a[i][j]) {             cout <<  No n ;             exit(0);           }           if (abs(ans[i] - ans[j]) > 1 && a[i][j]) {             cout <<  No n ;             exit(0);           }         }       }     }     cout <<  Yes n ;     ans[n] = 0;     cout << ans << endl;     exit(0);   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 0; i < m; ++i) {       int first, second;       scanf( %d%d , &first, &second);       --first;       --second;       a[first][second] = a[second][first] = 1;     }     int A = -1, B = -1, C = -1;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < n; ++j) {         for (int k = 0; k < n; ++k) {           if (i == j || j == k) {             continue;           }           if (a[i][j] && a[i][k]) {             if (!a[j][k]) {               A = j;               B = i;               C = k;             }           }         }       }     }     if (A == -1) {       ans[0] =  a ;       for (int i = 1; i < n; ++i) {         if (a[0][i]) {           ans[i] =  a ;         } else {           ans[i] =  c ;         }       }       die();     }     ans[B] =  b ;     ans[A] =  a ;     ans[C] =  c ;     for (int i = 0; i < n; ++i) {       if (i == A || i == B || i == C) continue;       if (a[A][i] && a[B][i] && a[C][i])         ans[i] =  b ;       else if (a[A][i] && a[B][i])         ans[i] =  a ;       else         ans[i] =  c ;     }     die();   }
#pragma GCC optimize( Ofast )   #include<bits/stdc++.h>   #define int long long   using namespace std;   void fileio(const string &s)   {    freopen((s+ .in ).c_str(), r ,stdin);    freopen((s+ .out ).c_str(), w ,stdout);   }   const int INF=4e18;   inline int read()   {    int x=0;    bool flag=1;    char c=getchar();    while(c< 0 ||c> 9 )    {     if(c== - )      flag=0;     c=getchar();    }    while(c>= 0 &&c<= 9 )    {     x=(x<<1)+(x<<3)+c- 0 ;     c=getchar();    }    return (flag?x:~(x-1));   }   int t,tx,ty,ax,ay,bx,by;    void solve()   {    ax=read();    ay=read();    bx=read();    by=read();    int ans=abs(ax-bx)+abs(ay-by);    tx=read();    ty=read();    if(tx==ax&&tx==bx)    {     if(ay<ty&&ty<by)      ans+=2;     if(ay>ty&&ty>by)      ans+=2;    }    if(ty==ay&&ty==by)    {     if(ax<tx&&tx<bx)      ans+=2;     if(ax>tx&&tx>bx)      ans+=2;    }    cout<<ans<<endl;   }   signed main()   {    t=read();    while(t--)     solve();    return 0;   }
#include <bits/stdc++.h>   using namespace std;   int x[1000001][2];   int main() {     int i, j, k, l, test, m, n;     int a[4100];     scanf( %d , &n);     int c[4100];     for (i = 0; i < n; i++) {       scanf( %d , &a[i]);       c[i] = a[i];     }     sort(c, c + n);     int b[4100];     int d[4100];     b[0] = c[0];     d[0] = 1;     int in = 0;     for (i = 1; i < n; i++)       if (c[i] != b[in]) {         d[++in] = 1;         b[in] = c[i];       } else {         d[in]++;       }     int g = 0;     for (i = 0; i <= in; i++) g = max(g, d[i]);     int f = 0;     for (i = 0; i <= in; i++) {       for (j = 0; j <= in; j++) x[b[j]][0] = x[b[j]][1] = 0;       int val = b[i];       for (j = 0; j < n; j++) {         if (a[j] == val)           x[val][1]++;         else {           k = a[j];           if (x[k][1] == x[val][1])             ;           else {             x[k][1] = x[val][1];             x[k][0] += 2;           }         }       }       for (j = 0; j <= in; j++) {         if (x[b[j]][1] != x[val][1]) x[b[j]][0]++;       }       for (j = 0; j <= in; j++) f = max(f, x[b[j]][0]);     }     cout << max(f, g) << endl;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   using namespace std;   long long n, a[100007], x, ans, t, res, tmp;   vector<long long> v, cur;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n;     for (long int i = 0; i < n; i++) {       cin >> x;       if (x) v.push_back(i);     }     if (v.size() < 2) {       cout << -1;       return 0;     }     if (v.size() < 4) {       if (v.size() == 2)         cout << v[1] - v[0];       else         cout << v[2] - v[0];       return 0;     }     ans = 1e12;     for (long int i = 2; i * i <= v.size(); i++) {       if (v.size() % i != 0) continue;       tmp = i;       for (long int k = 0; k < 2; k++, i = v.size() / i) {         t = 0;         res = 0;         for (auto j : v) {           cur.push_back(j);           t++;           if (t % i == 0) {             t = 0;             for (auto h : cur) res += abs(cur[i / 2] - h);             cur.clear();           }         }         ans = min(ans, res);       }       i = tmp;     }     res = 0;     for (auto i : v) {       res += abs(i - v[v.size() / 2]);     }     cout << min(res, ans);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     string s;     cin >> s;     vector<int> a;     for (int i = 1; i <= n; i++)       if (n % i == 0) a.push_back(i);     for (int i = 1; i < a.size(); i++) {       for (int j = 0; j < a[i] / 2; j++) swap(s[j], s[a[i] - j - 1]);     }     cout << s << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int key;     vector<int> v;     for (int i = 0; i < n; ++i) {       cin >> key;       v.push_back(key);     }     int max = v[0];     int min = v[0];     int amz = 0;     for (int i = 1; i < n; ++i) {       if (v[i] > max) {         amz++;         max = v[i];       }       if (v[i] < min) {         amz++;         min = v[i];       }     }     cout << amz;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     for (int i = 0; i < t; i++) {       int n;       cin >> n;       vector<int> p(n), result;       for (int& j : p) {         cin >> j;       }       vector<int> maximums;       vector<bool> used(n, false);       result.push_back(p[0]);       used[p[0] - 1] = true;       int idx = 0;       for (idx; idx < p[0] - 1; idx++) {         maximums.push_back(idx + 1);       }       idx++;       for (int j = 1; j < n; j++) {         if (p[j] > p[j - 1]) {           result.push_back(p[j]);           used[p[j] - 1] = true;           for (idx; idx < p[j] - 1; idx++) {             if (!used[idx]) maximums.push_back(idx + 1);           }           idx++;         } else {           if (maximums.size() > 0) {             used[maximums[maximums.size() - 1] - 1] = true;             result.push_back(maximums[maximums.size() - 1]);             maximums.pop_back();           }         }       }       if (result.size() < n)         cout << -1 << endl;       else {         for (int& i : result) {           cout << i <<    ;         }         cout << endl;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int mat[105][105];   int nodes[105];   int n, m;   int cycles = 0;   void cycle_det(int cur, int parent);   int main() {     cin >> n >> m;     memset(mat, 0, sizeof mat);     memset(nodes, 0, sizeof nodes);     for (int i = 0; i < m; i++) {       int _1, _2;       cin >> _1 >> _2;       mat[_1 - 1][_2 - 1] = 1;       mat[_2 - 1][_1 - 1] = 1;     }     cycle_det(0, -1);     int count = 0;     for (int i = 0; i < n; i++)       if (nodes[i] == 1) count++;     if (cycles != 2 || count != n)       cout <<  NO n ;     else       cout <<  FHTAGN! n ;   }   void cycle_det(int cur, int parent) {     if (cycles > 2) return;     nodes[cur] = 1;     for (int i = 0; i < n; i++) {       int tmp = 0;       if (mat[cur][i] == 1 && !nodes[i]) {         nodes[i] = 1;         cycle_det(i, cur);       } else if (mat[cur][i] == 1 && i != parent && nodes[i]) {         cycles++;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const long long INF = 1e9 + 7;   const int MAXN = 1e6 + 7;   const double EPS = 1e-8;   long long power(long long a, long long k) {     if (!k) {       return 1;     }     long long b = power(a, k / 2);     b = b * b % INF;     if (k % 2) {       return a * b % INF;     } else {       return b;     }   }   vector<vector<long long> > gr;   vector<long long> p, r;   long long all_sz = 0;   long long get(long long v) { return (p[v] == v ? v : p[v] = get(p[v])); }   bool uni(long long v, long long u) {     v = p[v];     u = p[u];     if (v == u) {       return false;     }     if (r[v] == r[u]) {       r[u]++;     }     if (r[v] > r[u]) {       swap(v, u);     }     p[v] = u;     all_sz--;     return true;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n, m, k;     cin >> n >> m >> k;     p.resize(n, 0);     iota(p.begin(), p.end(), 0);     r.resize(n, 0);     vector<long long> c(n);     for (long long i = 0; i < n; i++) {       cin >> c[i];     }     long long all = power(2, n + k);     gr.resize(n);     map<long long, vector<pair<long long, long long> > > d;     for (long long i = 0; i < m; i++) {       long long v, u;       cin >> v >> u;       v--, u--;       d[c[v] ^ c[u]].push_back({v, u});     }     long long bad = 0;     for (auto pt : d) {       all_sz = n;       set<long long> used;       for (auto t : pt.second) {         long long v = t.first, u = t.second;         used.insert(v);         used.insert(u);         if (get(v) == get(u)) continue;         bad = (bad + power(2, all_sz - 1)) % INF;         uni(v, u);       }       for (long long v : used) {         p[v] = v;         r[v] = 0;       }     }     cout << (all - bad + INF) % INF;   }
#include <bits/stdc++.h>   using namespace std;   long double pi = 3.141592653589793238;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     ;     long long t;     cin >> t;     while (t--) {       string x;       cin >> x;       long long n = x.length();       if (n == 0) {         cout << 0 << endl;       }       if (n == 1) {         cout << 5 << endl;         continue;       }       set<tuple<long long, long long, long long, long long>> r1;       long long curx = 0;       long long cury = 0;       long long cnt = 5;       if (x[0] ==  N ) {         cury++;         r1.insert(make_tuple(curx, cury - 1, curx, cury));         r1.insert(make_tuple(curx, cury, curx, cury - 1));       }       if (x[0] ==  S ) {         cury--;         r1.insert(make_tuple(curx, cury + 1, curx, cury));         r1.insert(make_tuple(curx, cury, curx, cury + 1));       }       if (x[0] ==  E ) {         curx++;         r1.insert(make_tuple(curx - 1, cury, curx, cury));         r1.insert(make_tuple(curx, cury, curx - 1, cury));       }       if (x[0] ==  W ) {         curx--;         r1.insert(make_tuple(curx + 1, cury, curx, cury));         r1.insert(make_tuple(curx, cury, curx + 1, cury));       }       for (long long i = 1; i < n; i++) {         if (x[i] ==  N ) {           cury++;           if (r1.find(make_tuple(curx, cury - 1, curx, cury)) == r1.end()) {             r1.insert(make_tuple(curx, cury - 1, curx, cury));             cnt += 5;             r1.insert(make_tuple(curx, cury, curx, cury - 1));           } else             cnt++;         }         if (x[i] ==  S ) {           cury--;           if (r1.find(make_tuple(curx, cury + 1, curx, cury)) == r1.end()) {             r1.insert(make_tuple(curx, cury + 1, curx, cury));             cnt += 5;             r1.insert(make_tuple(curx, cury, curx, cury + 1));           } else             cnt++;         }         if (x[i] ==  E ) {           curx++;           if (r1.find(make_tuple(curx - 1, cury, curx, cury)) == r1.end()) {             r1.insert(make_tuple(curx - 1, cury, curx, cury));             cnt += 5;             r1.insert(make_tuple(curx, cury, curx - 1, cury));           } else             cnt++;         }         if (x[i] ==  W ) {           curx--;           if (r1.find(make_tuple(curx + 1, cury, curx, cury)) == r1.end()) {             r1.insert(make_tuple(curx + 1, cury, curx, cury));             cnt += 5;             r1.insert(make_tuple(curx, cury, curx + 1, cury));           } else             cnt++;         }       }       cout << cnt << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 2e3 + 10;   long long n, k;   char s[MAXN];   int num[33];   int main() {     while (cin >> s) {       cin >> k;       int len = strlen(s);       if (len < k) {         cout <<  impossible  << endl;       } else {         memset(num, 0, sizeof num);         for (int i = 0; i < len; ++i) {           num[s[i] -  a ]++;         }         long long ans = 0;         for (int i = 0; i < 26; ++i) {           if (num[i]) ++ans;         }         if (ans <= k)           cout << k - ans << endl;         else           cout << 0 << endl;       }     }     return 0;   }
#include<bits/stdc++.h>      #define mamun()         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);   #define endl              n    #define tab               t    #define ll              long long   #define lli             long long int   #define pb              push_back   #define fin(file)       freopen(file .txt ,  r , stdin)   #define fout(file)      freopen(file .txt ,  w , stdout)   #define FOR(i, a, b)    for (int i=a; i<=b; i++)   #define loop(i, n)      for (int i=0; i<n; i++)   #define srt(v)          sort(v.begin(), v.end())   #define rsrt(v)         sort(v.rbegin(), v.rend())   #define Fill(ar, val)   memset(ar, val, sizeof(ar))   #define testcase()      ll t; cin>>t; while(t--)      using namespace std;      int main()   {       mamun();       //fin( input );          testcase()       {           ll n, Ecnt=0, Ocnt=0;           cin>> n;           vector<ll> v(2*n);              loop(i, 2*n) cin>> v[i];           // srt(v);              loop(i, 2*n)           {               if(v[i] % 2 == 0)               {                   Ecnt++;               }               else               {                   Ocnt++;               }           }           if(Ecnt == Ocnt)               cout<<  Yes  << endl;           else               cout<<  No  << endl;       }          return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   string ans, word;   vector<int> get_pi(string s) {     int j = 0, k = -1;     vector<int> q;     q.clear();     q.push_back(-1);     while (j < s.size()) {       if (k == -1 || s[j] == s[k]) {         q.push_back(++k);         ++j;       } else {         k = q[k];       }     }     return q;   }   int main() {     ios::sync_with_stdio(false);     ans =   ;     cin >> n;     for (int i = 1; i <= n; ++i) {       cin >> word;       int l = min(word.size(), ans.size());       string s = word +  # ;       s.insert(s.end(), ans.end() - l, ans.end());       vector<int> pi = get_pi(s);       int move = pi[pi.size() - 1];       ans.insert(ans.end(), word.begin() + move, word.end());     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dcount(long long i) {     int c = 0;     while (i > 0) {       i = i / 10;       c++;     }     return c;   }   int main() {     long long n, cnt = 0;     cin >> n;     int num = dcount(n);     for (long long int i = 0; i < num; i++) {       cnt += n > (pow(10, i + 1) - 1) ? (pow(10, i + 1) - pow(10, i)) * (i + 1)                                       : (n - pow(10, i) + 1) * (i + 1);     }     cout << cnt;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int n;     cin >> n;     int a = 1, b = 2;     while (n--) {       int c;       cin >> c;       if (c == a) {         b = 6 - (a + b);       } else if (c == b) {         a = 6 - (a + b);       } else {         cout <<  NO n ;         return 0;       }     }     cout <<  YES n ;   }