malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int T;   double n;   int main() {     cin >> T;     while (T-- > 0) {       cin >> n;       printf( %.9lf n , (1.0 / (2.0 * sin(acos(-1.0) / (2.0 * n)))) *                             cos(acos(-1.0) / 2 / n) * 2);     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int t, n, i, j;     string second;     cin >> t;     while (t--) {       cin >> second;       vector<int> v1, v2;       n = second.length();       for (i = 0; i < n; i++) {         if ((second[i] -  0 ) % 2)           v1.push_back(second[i] -  0 );         else           v2.push_back(second[i] -  0 );       }       string ans =   ;       i = j = 0;       while (i < v1.size() && j < v2.size()) {         if (v1[i] < v2[j])           ans += char(v1[i++] +  0 );         else           ans += char(v2[j++] +  0 );       }       while (i < v1.size()) ans += char(v1[i++] +  0 );       while (j < v2.size()) ans += char(v2[j++] +  0 );       cout << ans <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   char question[4][100];   int len[4];   int main() {     for (int i = 0; i < 4; i++) {       cin >> question[i];       string s = question[i];       len[i] = s.size() - 2;     }     int count_ = 0;     int index = -1;     for (int i = 0; i < 4; i++) {       int n;       n = len[0];       len[0] = len[i];       len[i] = n;       if (((len[0] <= (len[1] / 2)) && (len[0] <= (len[2] / 2)) &&            (len[0] <= (len[3] / 2))) ||           ((len[0] >= (2 * len[1])) && (len[0] >= (2 * len[2])) &&            (len[0] >= (2 * len[3])))) {         index = i;         count_++;       }     }     if (count_ == 1) {       cout << (char)(index + 65);     } else {       cout <<  C ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int x[1005], y[1005], r[1005], level[1005];   long long sum[1005];   vector<pair<int, int> > X[1005];   void dfs(int node, int l) {     level[node] = l;     int i;     for (i = 0; i < X[node].size(); i++) {       if (level[X[node][i].second] <= level[node]) dfs(X[node][i].second, l + 1);     }   }   bool check(int ind1, int ind2) {     if (r[ind1] < r[ind2]) return false;     long double dist = (long long)(x[ind1] - x[ind2]) * (x[ind1] - x[ind2]) +                        (long long)(y[ind1] - y[ind2]) * (y[ind1] - y[ind2]);     dist = sqrtl(dist);     if (dist + r[ind2] > (long double)r[ind1]) return false;     return true;   }   int main() {     int n;     scanf( %d , &n);     int i;     for (i = 1; i <= n; i++) {       scanf( %d%d%d , x + i, y + i, r + i);     }     for (i = 1; i <= n; i++) {       for (int j = i + 1; j <= n; j++) {         if (check(i, j)) X[i].push_back(make_pair(r[j], j));         if (check(j, i)) X[j].push_back(make_pair(r[i], i));       }     }     for (i = 1; i <= n; i++) {       sort(X[i].begin(), X[i].end());       reverse(X[i].begin(), X[i].end());     }     for (i = 1; i <= n; i++) {       if (!level[i]) dfs(i, 1);     }     for (i = 1; i <= n; i++) {       sum[level[i]] += (long long)r[i] * r[i];     }     int cnt = 0;     long long ans = 0;     for (i = 1; i <= 1000; i++) {       if (i <= 2) {         ans += sum[i];         continue;       }       if (i % 2)         ans -= sum[i];       else         ans += sum[i];     }     long double p = (long double)(3.14159265359) * ans;     cout.precision(9);     cout << fixed << p;   }
#include <bits/stdc++.h>   using namespace std;   bool comp(const int a, const int b) { return a > b; }   long long binpow(long long a, long long n, int mod) {     long long res = 1;     while (n)       if (n & 1) {         res *= a;         res %= mod;         --n;       } else {         a *= a;         a %= mod;         n >>= 1;       }     if (res == 0) res = mod;     return res;   }   vector<int> prefix_function(string s) {     int n = (int)s.length();     vector<int> pi(n);     for (int i = 1; i < n; ++i) {       int j = pi[i - 1];       while (j > 0 && s[i] != s[j]) j = pi[j - 1];       if (s[i] == s[j]) ++j;       pi[i] = j;     }     return pi;   }   string ss1, ss2;   int main() {     vector<int> a = prefix_function( a#aa );     int n;     cin >> n;     string s, str;     vector<string> v;     for (int i = 0; i < n; i++) {       cin >> str;       v.push_back(str);     }     for (int i =  a ; i <=  z ; i++) {       bool bb = true;       ss1 = i;       string f = ss1;       for (int ii = 0; ii < n && bb == true; ii++) {         vector<int> a = prefix_function(f +  #  + v[ii]);         for (int jj = f.length() + 1; jj < a.size() && bb == true; jj++) {           if (a[jj] == f.size()) {             bb = false;             break;           }         }       }       if (bb == true) {         cout << f;         return 0;       }     }     for (int i =  a ; i <=  z ; i++) {       for (int j =  a ; j <=  z ; j++) {         bool bb = true;         ss1 = i;         ss2 = j;         string f = ss1.append(ss2);         for (int ii = 0; ii < n && bb == true; ii++) {           vector<int> a = prefix_function(f +  #  + v[ii]);           for (int jj = f.length() + 1; jj < a.size() && bb == true; jj++) {             if (a[jj] == f.size()) {               bb = false;               break;             }           }         }         if (bb == true) {           cout << f;           return 0;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct l {     int index;     int depth;     int color;   };   int a[100001];   struct BFSearch {     vector<pair<l, vector<int> > > adj;     queue<l> k;     void clear1() {       for (int i = 0; i < adj.size(); i++) {         adj[i].first.color = 0;         adj[i].first.depth = -1;       }     }     void bfs(int i) {       if (i > adj.size() - 1) return;       l o;       int p;       adj[i].first.color = 0;       adj[i].first.depth = 0;       k.push(adj[i].first);       while (k.size() != 0) {         o = k.front();         k.pop();         for (int i = 0; i < adj[o.index].second.size(); i++) {           p = adj[o.index].second[i];           if (adj[p].first.color == 0) {             adj[p].first.color = 1;             adj[p].first.depth = o.depth + 1;             k.push(adj[p].first);           }         }         adj[o.index].first.color = 2;       }     }   };   int main() {     pair<l, vector<int> > op;     BFSearch k;     int n, temp;     l p;     p.depth = -1;     p.color = 0;     cin >> n;     vector<int> x;     for (int i = 0; i < n; i++) {       op.second = x;       p.index = i;       op.first = p;       k.adj.push_back(op);     }     for (int i = 1; i < n; i++) {       cin >> temp;       k.adj[i].second.push_back(temp - 1);       k.adj[temp - 1].second.push_back(i);     }     k.bfs(0);     for (int i = 0; i < k.adj.size(); i++) {       a[k.adj[i].first.depth]++;     }     long sum = 0;     for (int i = 0; i < k.adj.size(); i++) {       if (a[i] % 2 == 1) sum += 1;     }     cout << sum;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 3e5 + 5;   char s[N];   int main(void) {     int n;     while (cin >> n) {       int cntl = 0;       int cntr = 0;       int cntq = 0;       getchar();       n = abs(n);       scanf( %s , s);       if (s[0] ==  )  || s[n - 1] ==  ( ) {         puts( :( );         continue;       }       if (n == 0) {         puts( :( );         continue;       }       if (n & 1) {         puts( :( );         continue;       }       for (int i = 0; i < n; i++) {         if (s[i] ==  ) )           cntr++;         else if (s[i] ==  ( )           cntl++;         else           cntq++;       }       if (abs(cntl - cntr) > cntq) {         puts( :( );         continue;       }       int needl = n / 2 - cntl;       for (int i = 0; i < n; i++) {         if (needl) {           if (s[i] ==  ? ) {             s[i] =  ( ;             needl--;           }         } else {           if (s[i] ==  ? ) s[i] =  ) ;         }       }       bool flg = false;       cntl = 0;       cntr = 0;       for (int i = 0; i < n; i++) {         if (s[i] ==  ) )           cntr++;         else           cntl++;         if ((i + 1) % 2 == 0) {           if (cntr == cntl && i + 1 != n) {             flg = true;             break;           }         }       }       if (flg == false) {         printf( %s n , s);       } else         puts( :( );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   FILE* in = stdin;   FILE* out = stdout;   const int MAX = 100001;   int n, k;   int a[MAX];   int color[256];   void solve() {     memset(color, -1, sizeof(color));     color[0] = 0;     for (int i = 0; i < n; i++) {       if (color[a[i]] != -1) continue;       int left = -1;       for (int c = 0;; c++) {         if (color[a[i] - c] != -1) {           left = a[i] - c;           break;         }       }       if (color[left] + k - 1 >= a[i]) {         for (int c = left + 1; c <= a[i]; c++) color[c] = color[left];         continue;       }       int at = a[i];       if (at - k + 1 > left) {         for (int c = at - k + 1; c <= at; c++) color[c] = at - k + 1;         continue;       }       for (int c = left + 1; c <= a[i]; c++) color[c] = left + 1;     }     for (int i = 0; i < n; i++)       fprintf(out,  %d%c , color[a[i]], i + 1 == n ?   n  :    );   }   int main(void) {     fscanf(in,  %d %d , &n, &k);     for (int i = 0; i < n; i++) fscanf(in,  %d , &a[i]);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     set<char> s;     char ch;     int rep = 0;     for (int i = 0; i < n; i++) {       cin >> ch;       if (s.find(ch) != s.end()) rep++;       s.insert(ch);     }     if (26 - s.size() >= rep)       cout << rep;     else       cout <<  -1 ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     vector<int> p;     vector<int> n;     vector<int> z;     int t;     cin >> t;     int x;     for (int i = 0; i < t; i++) {       cin >> x;       if (x > 0)         p.push_back(x);       else if (x < 0)         n.push_back(x);       else         z.push_back(x);     }     if (t == 1)       cout << x;     else if (z.size() == t) {       for (int i = 0; i < z.size(); i++) cout << z[i] <<    ;     } else if (z.size() + n.size() == t) {       if (n.size() == 1)         cout << 0;       else {         if (n.size() % 2 != 0) {           sort(n.rbegin(), n.rend());           for (int i = 1; i < n.size(); i++) cout << n[i] <<    ;         } else {           for (int i = 0; i < n.size(); i++) cout << n[i] <<    ;         }       }     } else if ((p.size() > 0 || p.size() == 0) &&                (n.size() > 0 || n.size() == 0)) {       for (int i = 0; i < p.size(); i++) cout << p[i] <<    ;       if (n.size() % 2 == 0) {         for (int i = 0; i < n.size(); i++) cout << n[i] <<    ;       } else {         sort(n.rbegin(), n.rend());         for (int i = 1; i < n.size(); i++) cout << n[i] <<    ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int t;   void solve() {     while (t--) {       long long int n, k, res = 0;       cin >> n >> k;       if (n < k)         res = k - n;       else if ((n - k) % 2 == 0 && n >= k) {         res = 0;       } else         res = 1;       cout << res <<   n ;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> t;     solve();   }
#include <bits/stdc++.h>   using namespace std;   int a[100005], n, k;   bool cmp(int x, int y) { return x % 10 > y % 10; }   int main() {     cin >> n >> k;     for (int i = 0; i < n; i++) cin >> a[i];     sort(a, a + n, cmp);     for (int i = 0; i < n; i++) {       if (a[i] % 10 == 0 || k < 10 - a[i] % 10) break;       k -= 10 - a[i] % 10;       a[i] += 10 - a[i] % 10;     }     for (int i = 0; i < n; i++) {       if (k < 10) break;       int cpy = a[i];       a[i] = min(100, a[i] + k - k % 10);       k -= (a[i] - cpy);     }     int ans = 0;     for (int i = 0; i < n; i++) ans += a[i] / 10;     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   const double pi = acos(-1);   const int N = 1e5 + 5;   int a[N];   int b[N];   int main() {     ios_base::sync_with_stdio(false);     int T;     cin >> T;     while (T--) {       int n;       cin >> n;       vector<int> ve1, ve2;       for (int i = 0; i < n; i++) cin >> a[i];       for (int i = 0; i < n; i++) cin >> b[i];       for (int i = 0; i < n; i++) ve1.push_back(a[i]);       for (int i = 0; i < n; i++) ve2.push_back(b[i]);       sort(ve1.begin(), ve1.end());       sort(ve2.begin(), ve2.end());       multiset<pair<int, long long> > mse;       bool res = true;       for (int i = 0; i < (n + 1) / 2; i++) {         int mn = min(a[i], a[n - i - 1]);         int mx = max(a[i], a[n - i - 1]);         mse.insert({mn, mx});       }       for (int i = 0; i < (n + 1) / 2; i++) {         int mn = min(b[i], b[n - i - 1]);         int mx = max(b[i], b[n - i - 1]);         pair<int, long long> x = {mn, mx};         if (mse.find(x) != mse.end()) {           mse.erase(mse.find(x));         } else {           res = false;         }       }       if (res)         cout <<  YES n ;       else         cout <<  NO n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int modexp(long long int a, long long int b) {     long long int ret = 1;     while (b) {       if ((b & 1)) {         ret *= a;         ret %= 1000000007;       }       a *= a;       a %= 1000000007;       b >>= 1;     }     return ret;   }   long long int fact[200000];   int main() {     int n, k;     long long int ret = 1;     fact[0] = 1;     int i;     for (i = 1; i <= 1000; i++) {       fact[i] = fact[i - 1] * i;       fact[i] %= 1000000007;     }     scanf( %d %d , &n, &k);     ret *= modexp(k, k - 1);     ret %= 1000000007;     ret *= modexp(n - k, n - k);     ret %= 1000000007;     cout << ret << endl;     return 0;   }
#include <bits/stdc++.h>   long long m;   long long from, to;   long long x, y;   int visit[2][1000010];   int main() {     std::cin >> m;     int i, time;     int cs[2], ci[2], targ[2];     for (i = 0; i < 2; ++i) {       std::cin >> from >> to >> x >> y;       time = 1;       int cur = from;       while (true) {         if (visit[i][cur]) {           cs[i] = time - visit[i][cur];           ci[i] = visit[i][cur];           break;         }         visit[i][cur] = time;         cur = (cur * x + y) % m;         ++time;       }       targ[i] = visit[i][to];     }     if (targ[0] == 0 || targ[1] == 0) {       std::cout << -1;     } else {       bool oncyc[2];       for (i = 0; i < 2; ++i) oncyc[i] = (targ[i] >= ci[i]);       if (!oncyc[0] && !oncyc[1]) {         if (targ[0] != targ[1])           std::cout << -1;         else           std::cout << targ[0] - 1;       } else if (!oncyc[0]) {         if (targ[0] >= targ[1] && !((targ[0] - targ[1]) % cs[1]))           std::cout << targ[0] - 1;         else           std::cout << -1;       } else if (!oncyc[1]) {         if (targ[1] >= targ[0] && !((targ[1] - targ[0]) % cs[0]))           std::cout << targ[1] - 1;         else           std::cout << -1;       } else {         long long cur = targ[0];         for (i = 0; i <= m + 1; ++i) {           if (cur >= targ[1] && (cur - targ[1]) % cs[1] == 0) break;           cur += cs[0];         }         if (i <= m + 1)           std::cout << cur - 1;         else           std::cout << -1;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 150001;   int a[N], vis[N];   int main() {     int n;     while (cin >> n) {       for (int i = 1; i <= n; i++) cin >> a[i];       sort(a + 1, a + n + 1);       memset(vis, 0, sizeof(vis));       int ans = 0;       for (int i = 1; i <= n; i++) {         if (vis[a[i] - 1] == 0 && a[i] != 1)           vis[a[i] - 1] = 1, ans++;         else if (vis[a[i]] == 0)           vis[a[i]] = 1, ans++;         else if (vis[a[i] + 1] == 0)           vis[a[i] + 1] = 1, ans++;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const string kStart =        What are you doing at the end of the world? Are you busy? Will you save          us? ;   const string kPrefix =  What are you doing while sending   ;   const string kCenter =   ? Are you busy? Will you send   ;   const string kTail =   ? ;   const int64_t kMaxK = 1.0E18;   const int64_t kInf = numeric_limits<int64_t>::max();   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     int Q;     cin >> Q;     vector<int64_t> L;     L.push_back(75);     for (;;) {       int64_t cand = 68 + 2 * L.back();       if (cand > kMaxK) {         break;       }       L.push_back(cand);     }     string R;     for (int q = 0; q < Q; ++q) {       int N;       int64_t K;       cin >> N >> K;       if (N < L.size()) {         if (K > L[N]) {           R +=  . ;           continue;         }       }       for (;;) {         if (N == 0) {           R += kStart[K - 1];           break;         }         if (K <= kPrefix.size()) {           R += kPrefix[K - 1];           break;         }         int64_t prev_len = N - 1 < L.size() ? L[N - 1] : kInf;         if (prev_len == kInf || K <= kPrefix.size() + prev_len) {           --N;           K -= kPrefix.size();           continue;         }         if (K <= kPrefix.size() + prev_len + kCenter.size()) {           R += kCenter[K - kPrefix.size() - prev_len - 1];           break;         }         if (K <= kPrefix.size() + 2 * prev_len + kCenter.size()) {           --N;           K -= kPrefix.size() + kCenter.size() + prev_len;           continue;         }         R += kTail[K - 2 * prev_len - kPrefix.size() - kCenter.size() - 1];         break;       }     }     cout << R <<   n ;     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:1000000000,1000000000 )   using namespace std;   const long long inf = 1e18 + 7;   const long long mod = 1e9 + 7;   const double eps = 1e-9;   const double PI = 2 * acos(0.0);   const double E = 2.71828;   int f[1 << 24], sum[1 << 24], n, k, a[24], b[2];   int main(void) {     scanf( %d , &n);     for (long long(i) = 0; (i) < (long long)(n); (i)++) scanf( %d , &a[i]);     scanf( %d , &k);     b[0] = b[1] = -1;     for (long long(i) = 0; (i) < (long long)(k); (i)++) scanf( %d , &b[i]);     f[0] = 1;     for (long long(i) = 0; (i) < (long long)(1 << n); (i)++) {       if (i) sum[i] = sum[i & (i - 1)] + a[__builtin_ctz(i)];       if (sum[i] == b[0] || sum[i] == b[1]) continue;       for (long long j = i; j; j &= j - 1) {         f[i] += f[i ^ (j & -j)];         if (f[i] >= mod) f[i] -= mod;       }     }     printf( %d n , f[(1 << n) - 1]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int read() {     int x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = (x << 3) + (x << 1) + (ch ^ 48);       ch = getchar();     }     return x * f;   }   struct node {     int u, v, w, t;   } e[1000005], E[1000005];   int cmp(node a, node b) { return a.w < b.w; }   struct Union_Find_Set {     int top, stk[1000005], siz[1000005], tot, fa[1000005];     void init(int x) {       tot = x;       for (int i = 1; i <= x; i++) fa[i] = i, siz[i] = 1;       return;     }     int find(int x) {       while (x != fa[x]) x = fa[x];       return x;     }     void link(int x, int y) {       int u = find(x), v = find(y);       if (u == v) return;       if (siz[u] < siz[v]) swap(u, v);       tot -= (siz[u] & 1);       tot -= (siz[v] & 1);       siz[u] += siz[v];       fa[v] = u;       tot += (siz[u] & 1);       stk[++top] = v;       return;     }     void cut() {       int x = stk[top], u = find(x);       --top;       tot -= (siz[u] & 1);       siz[u] -= siz[x];       fa[x] = x;       tot += (siz[u] & 1);       tot += (siz[x] & 1);     }   } S;   int n, m, ans[1000005], id[1000005];   void solve(int l, int r, int x, int y) {     if (l > r) return;     int mid = (l + r) >> 1, pre = S.top;     for (int i = l; i <= mid; i++)       if (id[i] < x) S.link(E[i].u, E[i].v);     for (int i = x; i <= y; i++) {       if (e[i].t <= mid) S.link(e[i].u, e[i].v);       if (!S.tot) {         ans[mid] = i;         break;       }     }     while (S.top > pre) S.cut();     if (!ans[mid]) {       for (int i = l; i <= mid; i++)         if (id[i] < x) S.link(E[i].u, E[i].v);       solve(mid + 1, r, x, y);       while (S.top > pre) S.cut();       return;     }     for (int i = l; i <= mid; i++)       if (id[i] < x) S.link(E[i].u, E[i].v);     solve(mid + 1, r, x, ans[mid]);     while (S.top > pre) S.cut();     for (int i = x; i < ans[mid]; i++)       if (e[i].t < l) S.link(e[i].u, e[i].v);     solve(l, mid - 1, ans[mid], y);     while (S.top > pre) S.cut();   }   int main() {     n = read();     m = read();     S.init(n);     for (int i = 1; i <= m; i++) {       e[i].u = read();       e[i].v = read();       e[i].w = read();       e[i].t = i;     }     for (int i = 1; i <= m; i++) E[i] = e[i];     sort(e + 1, e + 1 + m, cmp);     for (int i = 1; i <= m; i++) id[e[i].t] = i;     solve(1, m, 1, m);     for (int i = 1; i <= m; i++) printf( %d n , ans[i] ? e[ans[i]].w : -1);     return 0;   }
#include <bits/stdc++.h>   int main(void) {     int n, k, p = 0, t, i, j, c = 0;     scanf( %d%d , &n, &k);     int x[n], y[n], z[k * 2];     for (i = 0; i < n; i++) {       scanf( %d , &x[i]);       y[i] = i + 1;     }     for (i = 0; i < n; i++) {       for (j = 0; j < n - 1; j++) {         if (x[j] < x[j + 1]) {           t = x[j];           x[j] = x[j + 1];           x[j + 1] = t;           t = y[j];           y[j] = y[j + 1];           y[j + 1] = t;         }       }     }     while (x[0] > x[n - 1] + 1 && p < k) {       p++;       z[c] = y[0];       z[c + 1] = y[n - 1];       c += 2;       x[0]--;       x[n - 1]++;       for (i = 0; i < n; i++) {         for (j = 0; j < n - 1; j++) {           if (x[j] < x[j + 1]) {             t = x[j];             x[j] = x[j + 1];             x[j + 1] = t;             t = y[j];             y[j] = y[j + 1];             y[j + 1] = t;           }         }       }     }     printf( %d %d n , x[0] - x[n - 1], p);     for (i = 0; i < p * 2; i += 2) {       printf( %d %d n , z[i], z[i + 1]);     }   }
#include <bits/stdc++.h>   using namespace std;   int arr[30001];   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       for (int i = 1; i <= n; i++) {         cin >> arr[i];       }       int dp1 = arr[1];       int dp2 = 0;       bool fail = 0;       for (int i = 2; i < n; i++) {         arr[i] = arr[i] - dp2;         if (arr[i] < 0) {           fail = 1;           break;         }         if (arr[i] > dp1) {           arr[i] = arr[i] - dp1;           dp2 = dp2 + arr[i];         } else {           dp1 = arr[i];         }       }       if (dp2 > arr[n]) {         fail = 1;       }       if (fail) {         cout <<  NO               <<   n ;       } else {         cout <<  YES               <<   n ;       }     }   }