malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int i, j, k, n, m, t, l;     cin >> t;     while (t--) {       string s, p, q =  abacaba , r;       cin >> n >> s;       int cnt = 0, cntt = 0;       p = s;       r = s;       for (i = 0; i < n; i++) {         int c = 0;         for (j = i, k = 0; j < i + 7 && j < n; j++) {           if (q[k] == s[j]) {             k++;             c++;           } else {             k = 0;             break;           }         }         if (c == 7) cnt++;         if (s[i] ==  ? ) cntt++;       }       if (cnt > 1)         cout <<  No  << endl;       else if (cntt == 0 && cnt == 0)         cout <<  No  << endl;       else {         int ans = 0;         if (cnt == 0) {           for (i = 0; i + 6 < n; i++) {             bool f = 1;             s = p;             for (j = 0; j < i; j++) {               if (s[j] ==  ? ) s[j] =  x ;             }             for (j = 0; j < 7; j++) {               if (s[j + i] != q[j] && s[j + i] !=  ? ) {                 f = 0;                 break;               } else if (s[j + i] ==  ? )                 s[j + i] = q[j];             }             if (f == 0) continue;             int con = 0;             if (f == 1) {               for (l = 0; l + 6 < n; l++) {                 int ok = 1;                 for (j = 0; j < 7; j++) {                   if (s[j + l] != q[j]) {                     ok = 0;                     break;                   }                 }                 con += ok;               }               if (con == 1) {                 cout <<  Yes  << endl;                 for (i = 0; i < n; i++)                   if (s[i] ==  ? ) s[i] =  x ;                 cout << s << endl;                 ans = 1;                 break;               } else                 continue;             }           }           if (ans == 0) cout <<  No  << endl;         } else if (cnt == 1) {           for (i = 0; i < n; i++) {             if (s[i] ==  ? ) s[i] =  x ;           }           cout <<  Yes  << endl;           cout << s << endl;         } else           cout <<  No  << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long d, n, m;     cin >> d >> n >> m;     vector<pair<long long, long long>> V(m);     for (auto &x : V) cin >> x.first >> x.second;     sort(V.begin(), V.end());     bool poss = true;     for (int i = 0; i < V.size() - 1; i++)       poss = poss && V[i].first + n >= V[i + 1].first;     poss = poss && V[0].first <= n;     poss = poss && d - V.back().first <= n;     if (!poss) {       printf( -1 n );       return 0;     }     sort(V.begin(), V.end(),          [](pair<long long, long long> a, pair<long long, long long> b) {            return a.second < b.second;          });     set<int> pos;     pos.insert(0);     pos.insert(d);     long long ans = 0;     for (auto &x : V) {       auto aft = pos.lower_bound(x.first);       auto bef = prev(aft);       long long reach = max(0ll, n - (x.first - *bef));       long long leave = min(n, *aft - x.first);       ans += x.second * max(0ll, leave - reach);       pos.insert(x.first);     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 3e5, N = 2e6 + 90, SQ = 300, base = 1999, mod = 1e9 + 7,                   INF = 1e9 + 1, lg = 30;   const long double eps = 1e-4;   long long n, a[maxn], b[maxn], c[maxn], d[maxn], cnt[maxn], s1, s2, tot;   inline bool check() {     for (long long i = 0; i < n; ++i) {       for (long long j = 0; j < lg; ++j) {         if (a[i] & (1ll << j)) {           cnt[j]++;         }       }     }     for (long long i = 0; i < n; ++i) {       long long res1 = 0, res2 = 0;       for (long long j = 0; j < lg; ++j) {         if (a[i] & (1ll << j)) {           res1 += (cnt[j] * (1ll << j));           res2 += (n - cnt[j]) * (1ll << j);         }         res2 += (cnt[j] * (1ll << j));       }       if (res1 != b[i] || res2 != c[i]) {         return 0;       }     }     return 1;   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     cin >> n;     for (long long i = 0; i < n; ++i) {       cin >> b[i];       s1 += b[i];     }     for (long long i = 0; i < n; ++i) {       cin >> c[i];       s2 += c[i];     }     if ((s1 + s2) % (2 * n) != 0) {       cout << -1 <<   n ;       return 0;     }     tot = (s1 + s2) / (2 * n);     for (long long i = 0; i < n; ++i) {       d[i] = b[i] + c[i];     }     for (long long i = 0; i < n; ++i) {       a[i] = (d[i] - tot) / n;     }     if (check()) {       for (long long i = 0; i < n; ++i) {         cout << a[i] <<    ;       }       cout <<   n ;     } else {       cout << -1 <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n, k, l, mx = 0, m, i, j, s = 0;     cin >> n >> k;     long long int a[n], t[n], sum[n], dv[n];     for (i = 0; i < n; i++) {       cin >> a[i];       s += a[i];       dv[i] = s;     }     s = 0;     for (i = 0; i < n; i++) {       cin >> t[i];       if (t[i] == 1) s += a[i];       sum[i] = s;     }     l = n - k + 1;     for (i = 0; i < l; i++) {       m = 0;       if (i > 0)         m += dv[i + k - 1] - dv[i - 1];       else         m += dv[i + k - 1];       if (i > 0) m += sum[i - 1];       m += sum[n - 1] - sum[i + k - 1];       if (m > mx) mx = m;     }     cout << mx << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1e9;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int n, m;     cin >> n >> m;     int sum = 0;     vector<int> a(n);     map<int, int> c;     c[0] = 1;     bool fl = 0;     long long ans = 0;     for (int i = 0; i < n; i++) {       cin >> a[i];       if (a[i] > m) sum++;       if (a[i] < m) sum--;       if (a[i] == m) fl = 1;       if (fl)         ans += c[sum] + c[sum - 1];       else         c[sum]++;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e6 + 3;   bool in[113];   bool odw[113];   bool prze[113];   vector<int> v[113];   string tab[MAXN];   vector<char> ans;   bool por = false;   void DFS(int x) {     prze[x] = true;     odw[x] = true;     for (auto it : v[x]) {       if (prze[it])         por = true;       else if (!odw[it])         DFS(it);     }     ans.push_back(char(x +  a ));     prze[x] = false;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     int n, k, p;     bool check;     cin >> n >> k;     for (int i = 1; i <= n; i++) {       cin >> p;       for (int j = 0; j < k; j++) {         cin >> tab[p * k + j];         for (auto &it : tab[p * k + j]) in[it -  a ] = true;       }     }     for (int i = 1; i < n * k; i++) {       check = false;       for (unsigned int j = 0; j < min(tab[i].size(), tab[i - 1].size()); j++) {         if (tab[i][j] != tab[i - 1][j]) {           check = true;           v[tab[i - 1][j] -  a ].push_back(tab[i][j] -  a );           break;         }       }       if (!check && tab[i - 1].size() > tab[i].size()) por = true;     }     for (int i = 0; i < 26; i++) {       if (!odw[i] && in[i]) DFS(i);     }     if (por)       cout <<  IMPOSSIBLE ;     else {       for (int i = (int)(ans.size()) - 1; i >= 0; i--) cout << ans[i];     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int Maxn = 200005;   int n, m;   long long ans[Maxn];   struct Segment {     long long l, r;     int pos;   } A[Maxn], land[Maxn];   bool cmp(const Segment &a, const Segment &b) {     return a.l < b.l || a.l == b.l && a.r < b.r;   }   struct node {     int pos;     long long val;     node() {}     node(int _pos, long long _val) {       pos = _pos;       val = _val;     }   } p[Maxn];   bool operator<(node a, node b) { return a.val > b.val; }   bool cmp2(const node &a, const node &b) { return a.val < b.val; }   priority_queue<node> H;   int Get() {     char ch;     int v = 0;     bool f = false;     while (!isdigit(ch = getchar()))       if (ch ==  - ) f = true;     v = ch - 48;     while (isdigit(ch = getchar())) v = v * 10 + ch - 48;     if (f)       return -v;     else       return v;   }   int main() {     n = Get(), m = Get();     for (int i = 1; i <= n; i++) scanf( %I64d%I64d , &land[i].l, &land[i].r);     for (int i = 1; i <= m; i++) scanf( %I64d , &p[i].val), p[i].pos = i;     for (int i = 1; i <= n - 1; i++)       A[i].l = land[i + 1].l - land[i].r, A[i].r = land[i + 1].r - land[i].l,       A[i].pos = i;     n--;     sort(A + 1, A + 1 + n, cmp);     sort(p + 1, p + 1 + m, cmp2);     if (m < n) {       puts( No );       return 0;     }     long long mx = 0;     for (int i = 1, j = 1; i <= m; i++) {       while (A[j].l <= p[i].val && j <= n) H.push(node(A[j].pos, A[j].r)), j++;       while (!H.empty() && H.top().val < p[i].val) H.pop();       if (!H.empty()) {         node tmp = H.top();         ans[tmp.pos] = p[i].pos;         H.pop();       }     }     bool flag = true;     for (int i = 1; i <= n; i++)       if (ans[i] == 0) flag = false;     if (flag) {       puts( Yes );       for (int i = 1; i <= n - 1; i++) printf( %d  , ans[i]);       printf( %d n , ans[n]);     } else       puts( No );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int x, k, n, q, cnt;   long long num[10];   int bel[1 << 10];   struct Square {     long long num[75][75];     Square() {       for (int i = 1; i <= 70; i++) {         for (int j = 1; j <= 70; j++) num[i][j] = 1e18;         num[i][i] = 0;       }     }     Square operator*(const Square &a) const {       Square tmp;       for (int i = 1; i <= cnt; i++) tmp.num[i][i] = 1e18;       for (int i = 1; i <= cnt; i++)         for (int j = 1; j <= cnt; j++)           for (int k = 1; k <= cnt; k++)             tmp.num[i][j] = tmp.num[i][j] < (num[i][k] + a.num[k][j])                                 ? tmp.num[i][j]                                 : (num[i][k] + a.num[k][j]);       return tmp;     }     Square operator^(const int &x) {       if (!x) return Square();       Square tmp, tmp1;       int times = x;       for (int i = 1; i <= cnt; i++)         for (int j = 1; j <= cnt; j++) tmp1.num[i][j] = num[i][j];       while (times) {         if (times & 1) tmp = tmp * tmp1;         times >>= 1;         tmp1 = tmp1 * tmp1;       }       return tmp;     }   } one;   struct Stone {     int place;     long long val;   } stone[30];   bool calc(int tmp) {     int many = 0;     for (int i = 1; i <= 8; i++)       if (tmp & (1 << (i - 1))) many++;     return many == x;   }   bool cmp(Stone a, Stone b) { return a.place < b.place; }   int main() {     scanf( %d%d%d%d , &x, &k, &n, &q);     for (int i = 0; i <= (1 << k) - 1; i++)       if (calc(i)) bel[i] = ++cnt;     for (int i = 1; i <= k; i++) scanf( %lld , &num[i]);     for (int i = 1; i <= q; i++) scanf( %d%lld , &stone[i].place, &stone[i].val);     sort(stone + 1, stone + q + 1, cmp);     for (int i = 1; i <= cnt; i++) one.num[i][i] = 1e18;     for (int i = 1; i <= (1 << k) - 1; i++) {       if (i & 1) {         if (!bel[i]) continue;         for (int j = 1; j <= k; j++)           if (!((1 << j) & i)) one.num[bel[i]][bel[((1 << j) | i) >> 1]] = num[j];       } else if (bel[i])         one.num[bel[i]][bel[i >> 1]] = 0;     }     int now = 1;     long long sum = 0;     Square ans;     for (int i = 1; i <= q; i++) {       if (stone[i].place > n - x) {         sum += stone[i].val;         continue;       }       ans = ans * (one ^ (stone[i].place - now)), now = stone[i].place;       for (int j = 1; j <= (1 << k) - 1; j += 2)         if (bel[j])           for (int k = 1; k <= cnt; k++) ans.num[k][bel[j]] += stone[i].val;     }     ans = ans * (one ^ (n - x + 1 - now));     printf( %lld , ans.num[1][1] + sum);   }
#include <bits/stdc++.h>   using namespace std;   const int N = 110;   int a[N * N], n, T, dp[N * N], rec[305];   int cal(int x) {     int m = n * x, len = 0;     for (int i = 1; i <= m; i++) {       if (a[i] >= dp[len])         dp[++len] = a[i];       else {         int pos = upper_bound(dp + 1, dp + len + 1, a[i]) - dp;         dp[pos] = a[i];       }     }     return len;   }   int main() {     scanf( %d%d , &n, &T);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 1; i < n; i++) {       for (int j = 1; j <= n; j++) {         a[i * n + j] = a[j];       }     }     if (T <= n)       printf( %d n , cal(T));     else {       memset(rec, 0, sizeof(rec));       for (int i = 1; i <= n; i++) ++rec[a[i]];       int tmp = 0;       for (int i = 1; i <= n; i++) tmp = max(tmp, rec[a[i]]);       int ans = tmp * (T - n) + cal(n);       printf( %d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int r = 0;     int rr = 0;     int prev = 10000;     while (n--) {       int a, b;       cin >> a >> b;       if (a != b)         r = 1;       else {         if (a > prev) rr = 1;       }       prev = a;     }     if (r == 1)       cout <<  rated  << endl;     else {       if (rr == 0)         cout <<  maybe  << endl;       else         cout <<  unrated  << endl;     }     return 0;   }
#include <bits/stdc++.h>      using namespace std;   typedef long long ll;   #define endl   n    #define x1 fgdfgdg   const ll DIM = 2E5+7;   ll A[DIM];   ll GCD(ll a,ll b){       if (a==0 || b==0)return a+b;       return GCD(b%a,a);   }   int main() {       ios_base::sync_with_stdio(0);       cin.tie(0);       cout.tie(0);       ll n,m;       cin>>n>>m;       for(ll i = 1;i<=n;++i){           cin>>A[i];       }       sort(A+1,A+1+n);       ll gcd = A[2]-A[1];       for(ll i = 2;i<=n;++i){           if (i==2)gcd = A[i]-A[i-1];           else gcd = GCD(A[i]-A[i-1],gcd);       }       for(ll i = 1;i<=m;++i){           ll x;           cin>>x;           if (n!=1)           cout<<GCD(A[1]+x,gcd)<<   ;           else cout<<A[1]+x<<   ;       }       cout<<endl;       return 0;   }
#include <bits/stdc++.h>   using namespace std;   int k, d;   string a, b =  CODEFORCES ;   int main() {     cin >> a;     if (a == b) {       cout <<  YES n ;       return 0;     }     for (int i = 0; i < a.size(); i++) {       for (int j = i; j < a.size(); j++) {         string h;         for (int l = 0; l < i; l++) h += a[l];         for (int l = j + 1; l < a.size(); l++) h += a[l];         if (h == b) k = 1;       }     }     if (k == 1)       cout <<  YES n ;     else       cout <<  NO n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e6 + 10;   struct node {     int x, flag;   } a[2 * N];   bool cmp(const node a, const node b) {     if (a.x == b.x)       return a.flag > b.flag;     else       return a.x < b.x;   }   vector<pair<int, int> > ans;   int main(void) {     int n, k, l, r;     scanf( %d%d , &n, &k);     for (int i = 0; i < n; i++) {       scanf( %d%d , &l, &r);       a[2 * i].x = l;       a[2 * i].flag = 1;       a[2 * i + 1].x = r;       a[2 * i + 1].flag = -1;     }     n *= 2;     sort(a, a + n, cmp);     for (int i = 1; i < n; i++) a[i].flag += a[i - 1].flag;     for (int i = 0; i < n; i++) {       int cnt = 0;       if (a[i].flag >= k) {         l = a[i].x;         while (i < n && a[i].flag >= k) i++;         r = a[i].x;         ans.push_back(make_pair(l, r));       }     }     cout << ans.size() << endl;     for (int i = 0; i < ans.size(); i++)       cout << ans[i].first <<     << ans[i].second << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int a[3000];     int ert = 0, at = 0, as = 0;     int k = 1;     while (k < 3000) {       ert++;       if (ert % 10 == 0) at++;       if (ert % 10 == 0 and at % 10 == 0) as++;       if (k <= 9) {         a[k] = ert % 10;         k++;       } else {         if (k > 9 and k < 190) {           a[k] = at % 10;           k++;           a[k] = ert % 10;           k++;         } else {           a[k] = as % 10;           k++;           a[k] = at % 10;           k++;           a[k] = ert % 10;           k++;         }       }     }     cout << a[n];   }
#include <bits/stdc++.h>   using namespace std;   long long prime[2000006];   int main() {     long long i, j;     prime[1] = 1;     for (i = 2; i < 2000006; i++) {       for (j = 2 * i; j < 2000006; j += i) prime[j] = 1;     }     long long n;     cin >> n;     long long a[n], co = 0;     for (i = 0; i < n; i++) {       cin >> a[i];       if (a[i] == 1) co++;     }     if (co > 1) {       for (i = 0; i < n; i++) {         if (prime[a[i] + 1] == 0 && a[i] > 1) {           cout << co + 1 << endl << a[i] <<    ;           for (j = 0; j < co; j++) cout << 1 <<    ;           return 0;         }       }       cout << co << endl;       for (i = 0; i < co; i++) cout << 1 <<    ;       return 0;     }     for (i = 0; i < n; i++) {       for (j = i + 1; j < n; j++) {         if (prime[a[i] + a[j]] == 0) {           cout << 2 << endl;           cout << a[i] <<     << a[j];           return 0;         }       }     }     cout << 1 << endl << a[0];     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int table[20][20];   int A[20] = {0, 0, 4, 6, 8, 9, 11, 13, 15, 17};   int a[20][20];   int first_x, last_x, first_y, last_y;   int n, m;   int ans = 0, cur = 0;   void solve(int x, int y) {     if (x > last_x) {       if (cur > ans) {         ans = cur;         for (int i = 0; i <= 15; i++)           for (int j = 0; j <= 15; j++) table[i][j] = a[i][j];       }       return;     }     if (y > last_y) {       solve(x + 1, first_y);       return;     }     if (A[last_x - x] + cur <= ans) return;     if (!a[x][y] && !a[x][y + 1] && !a[x][y + 2] && !a[x + 1][y + 1] &&         !a[x + 2][y + 1]) {       a[x][y] = a[x][y + 1] = a[x][y + 2] = a[x + 1][y + 1] = a[x + 2][y + 1] =           cur + 1;       cur++;       solve(x, y + 1);       cur--;       a[x][y] = a[x][y + 1] = a[x][y + 2] = a[x + 1][y + 1] = a[x + 2][y + 1] = 0;     }     if (!a[x][y] && !a[x + 1][y] && !a[x + 2][y] && !a[x + 1][y - 1] &&         !a[x + 1][y - 2]) {       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 1][y - 1] = a[x + 1][y - 2] =           cur + 1;       cur++;       solve(x, y + 1);       cur--;       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 1][y - 1] = a[x + 1][y - 2] = 0;     }     if (!a[x][y] && !a[x + 1][y] && !a[x + 2][y] && !a[x + 2][y + 1] &&         !a[x + 2][y - 1]) {       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 2][y + 1] = a[x + 2][y - 1] =           cur + 1;       cur++;       solve(x, y + 1);       cur--;       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 2][y + 1] = a[x + 2][y - 1] = 0;     }     if (!a[x][y] && !a[x + 1][y] && !a[x + 2][y] && !a[x + 1][y + 1] &&         !a[x + 1][y + 2]) {       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 1][y + 1] = a[x + 1][y + 2] =           cur + 1;       cur++;       solve(x, y + 1);       cur--;       a[x][y] = a[x + 1][y] = a[x + 2][y] = a[x + 1][y + 1] = a[x + 1][y + 2] = 0;     }     solve(x, y + 1);   }   int main() {     cin >> n >> m;     first_x = 2, last_x = n + 1;     first_y = 2, last_y = m + 1;     for (int i = 0; i <= 15; i++)       a[i][0] = a[i][1] = a[i][last_y + 1] = a[i][last_y + 2] = a[0][i] =           a[1][i] = a[last_x + 1][i] = a[last_x + 2][i] = 1;     solve(first_x, first_y);     cout << ans << endl;     for (int i = first_x; i <= last_x; i++, cout << endl)       for (int j = first_y; j <= last_y; j++) {         if (table[i][j] == 0)           cout <<  . ;         else           cout << (char)( A  + table[i][j] - 1);       }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double EPS = 1e-6;   const double PI = acos(-1);   const int INF = 1e9;   void FAST() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);   }   signed main() {     FAST();     int n;     cin >> n;     vector<long long> a(n + n);     for (int i = 0; i < n + n; i++) {       cin >> a[i];     }     sort(a.begin(), a.end());     long long ans = (a[n - 1] - a[0]) * (a[n + n - 1] - a[n]);     for (int i = 1; i < n; i++) {       ans = min(ans, (a[n - 1 + i] - a[i]) * (a[n + n - 1] - a[0]));     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, i, j, first, end, count = 0;     cin >> n >> m;     vector<int> a(m + 1, 0);     for (i = 0; i < n; i++) {       cin >> first >> end;       for (j = first; j <= end; j++) a[j] = 1;     }     for (i = 1; i < m + 1; i++) {       if (a[i] == 0) count++;     }     cout << count << endl;     for (i = 1; i < m + 1; i++) {       if (a[i] == 0) cout << i <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void swap(int& a, int& b) {     int tmp;     tmp = a;     a = b;     b = tmp;   }   void QuickSort(int l, int h, int a[], int b[]) {     int i = l, j = h;     int pivot = a[l + rand() % (h - l + 1)];     while (i <= j) {       while (a[i] < pivot) i++;       while (a[j] > pivot) j--;       if (i <= j) {         swap(a[i], a[j]);         swap(b[i], b[j]);         i++;         j--;       }     }     if (l < j) QuickSort(l, j, a, b);     if (i < h) QuickSort(i, h, a, b);   }   int main() {     int n, r, avg;     long long s = 0;     cin >> n >> r >> avg;     int b[n + 1], a[n + 1];     for (int i = 1; i <= n; i++) {       cin >> a[i] >> b[i];       s += (long long)a[i];     }     long long d = (long long)n * avg - s;     if (d <= 0) {       cout << 0;       return 0;     }     QuickSort(1, n, b, a);     long long ans = 0;     for (int i = 1; i <= n; i++) {       if (d >= r - a[i]) {         ans += (long long)(r - a[i]) * b[i];         d -= r - a[i];         if (!d) break;       } else {         ans += (long long)d * b[i];         break;       }     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     set<int> s;     long long int n, m, k, a;     cin >> n >> m;     while (n--) {       cin >> k;       while (k--) {         cin >> a;         s.insert(a);       }     }     if (s.size() == m) {       cout <<  YES             <<   n ;     } else {       cout <<  NO             <<   n ;     }     return 0;   }