malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 105;   int zy[N][N * N / 2];   bool dp[N][N * N / 2];   deque<int> ans;   void dfs(int n, int k) {     if (n == 1) {       ans.push_back(1);       return;     } else {       if (zy[n][k] > 0) {         dfs(n - zy[n][k] + 1, k - zy[n][k]);         int sz = ans.size();         ans.push_front(zy[n][k] / 2 + sz);         if (zy[n][k] & 1) {           for (int i = (int)1; i <= (int)zy[n][k] / 2 - 2; ++i) {             ans.push_back(sz + zy[n][k] / 2 + i);             ans.push_back(sz + i);           }           ans.push_back(sz + zy[n][k] - 1);           ans.push_back(sz + zy[n][k] / 2 - 1);           ans.push_back(sz + zy[n][k] - 2);         } else {           for (int i = (int)1; i <= (int)zy[n][k] / 2 - 1; ++i) {             ans.push_back(sz + zy[n][k] / 2 + i);             ans.push_back(sz + i);           }         }       } else {         dfs(n + zy[n][k] + 1, k + zy[n][k] * (1 - zy[n][k]) / 2 + 1);         int sz = ans.size();         if (ans.front() > ans.back()) {           for (int i = (int)1; i <= (int)-zy[n][k] - 1; ++i)             ans.push_back(sz + i);         } else {           for (int i = (int)1; i <= (int)-zy[n][k] - 1; ++i)             ans.push_front(sz + i);         }       }     }   }   int main() {     dp[1][1] = 1;     for (int i = (int)2; i <= (int)100; ++i) {       for (int j = (int)i + 1; j <= (int)i * (i + 1) / 2; ++j) {         for (int k = (int)i; k >= (int)2; --k) {           if (k * (k + 1) / 2 <= j &&               dp[i - (k - 1)][j - (k * (k + 1) / 2 - 1)]) {             dp[i][j] = 1;             zy[i][j] = -k;             break;           }           if (k >= 4 && dp[i - k + 1][j - k]) {             dp[i][j] = 1;             zy[i][j] = k;             break;           }         }       }     }     int q, n, k;     cin >> q;     while (q--) {       cin >> n >> k;       if (!dp[n][k]) {         puts( NO );       } else {         dfs(n, k);         puts( YES );         while (ans.size()) {           cout << ans.front() <<    ;           ans.pop_front();         }         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   char ara[55][55];   bool ok(int i, int j) {     if (i >= n || j < 0 || j >= n) return false;     if (ara[i][j] ==  # ) return false;     return true;   }   int main() {     while (cin >> n) {       for (int i = 0; i < n; i++) {         for (int j = 0; j < n; j++) {           cin >> ara[i][j];         }       }       for (int i = 0; i < n; i++) {         for (int j = 0; j < n; j++) {           if (ara[i][j] ==  . ) {             if (ok(i + 1, j) && ok(i + 1, j - 1) && ok(i + 1, j + 1) &&                 ok(i + 2, j)) {               ara[i][j] = ara[i + 1][j] = ara[i + 1][j - 1] = ara[i + 1][j + 1] =                   ara[i + 2][j] =  # ;             }           }         }       }       bool flag = true;       for (int i = 0; i < n; i++) {         for (int j = 0; j < n; j++) {           if (ara[i][j] ==  . ) {             flag = false;           }         }       }       cout << (flag ?  YES n  :  NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, first = 0, second = 0, no = 0, spare;     cin >> n;     vector<long long> v1;     vector<long long> v2;     for (long long i = 0; i < n; i++) {       long long p;       cin >> p;       if (p > 0) {         first += p;         v1.push_back(p);       } else {         second += abs(p);         v2.push_back(abs(p));       }       if (i == n - 1) spare = p;     }     if (first > second)       cout <<  first ;     else if (second > first)       cout <<  second ;     else {       long long q = min(v1.size(), v2.size());       for (long long i = 0; i < q; i++) {         if (v1[i] > v2[i]) {           cout <<  first ;           no++;           break;         } else if (v1[i] < v2[i]) {           cout <<  second ;           no++;           break;         }       }       if (no == 0) {         if (spare > 0)           cout <<  first ;         else           cout <<  second ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T1, typename T2>   ostream& operator<<(ostream& cout, const pair<T1, T2>& a) {     return cout <<  (  << a.first <<  ;   << a.second <<  ) ;   }   template <typename T>   ostream& operator<<(ostream& cout, const vector<T>& a) {     if (a.size() == 0) {       return cout <<  () ;     }     cout <<  (  << a[0];     for (int i = 1; i < (int)a.size(); i++) {       cout <<  ;   << a[i];     }     return cout <<  ) ;   }   template <typename T>   ostream& operator<<(ostream& cout, const set<T>& a) {     if (a.size() == 0) {       return cout <<  {} ;     }     auto it = a.begin();     cout <<  {  << *it;     ++it;     for (; it != a.end(); ++it) {       cout <<  ;   << *it;     }     return cout <<  } ;   }   long long a1, a2, a3;   int main() {     cin >> a1;     cin >> a2;     cin >> a3;     cout << min({(a1 + a2) * 2, a1 + a3 + a2, (a1 + a3) * 2, (a2 + a3) * 2});   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int i, n, j;       cin >> n;       int arr[n], a[n];       set<int> s1, s2;       int flag = 0, p = 0;       for (i = 0; i < n; i++) {         cin >> arr[i];         a[i] = arr[i];         s2.insert(arr[i]);         if (arr[i] == 0) flag = 1;       }       sort(a, a + n);       if (flag == 1) {         p == 0;         for (i = 0; i < n; i++) {           s1.clear();           if (a[i] != 0) {             for (j = 0; j < n; j++) {               int p = (a[i] ^ arr[j]);               s1.insert(p);             }           }           if (s2 == s1) {             p = 1;             cout << a[i] <<   n ;             break;           }         }         if (p == 0) cout <<  -1 n ;       } else {         p = 0;         for (i = 1; i < 1025; i++) {           s1.clear();           for (j = 0; j < n; j++) {             s1.insert(i ^ arr[j]);           }           if (s2 == s1) {             p = 1;             cout << i <<   n ;             break;           }         }         if (p == 0) cout <<  -1 n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int ini() {     int x;     scanf( %d , &x);     return x;   }   long long inl() {     long long x;     scanf( %lld , &x);     return x;   }   void file_mamager() {}   int arr[105], mask[105], dp[105][1 << 17];   pair<int, int> path[105][1 << 17];   vector<int> primes;   void gen() {     for (int i = 2; i <= 60; i++) {       bool is = true;       for (int j = 2; j * j <= i; j++) {         if (i % j == 0) {           is = false;           break;         }       }       if (is) primes.push_back(i);     }   }   void bit_rep(int x) {     for (int i = 0; i < 10; i++) cout << ((x >> i) & 1);     cout <<   n ;   }   int main() {     gen();     int n = ini();     for (int i = 1; i <= n; i++) {       for (int j = 0; j < (1 << 17); j++) dp[i][j] = 1e8;     }     for (int i = 1; i <= n; i++) arr[i] = ini();     for (int i = 1; i <= 60; i++) {       int x = 0, y = i;       for (int j = 0; j < 17; j++) {         if (y % primes[j] == 0) {           x |= (1 << j);           while (y % primes[j] == 0) y /= primes[j];         }       }       mask[i] = x;     }     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= 60; j++) {         for (int k = 0; k < (1 << 17); k++) {           if ((k & mask[j]) == mask[j]) {             if (dp[i - 1][k ^ mask[j]] + abs(arr[i] - j) < dp[i][k]) {               dp[i][k] = dp[i - 1][k ^ mask[j]] + abs(arr[i] - j);               path[i][k] = {(k ^ mask[j]), j};             }           }         }       }     }     int mn = 1e8;     int x = (1 << 17) - 1;     for (int k = 0; k < (1 << 17); k++) {       if (dp[n][k] < mn) {         mn = dp[n][k];         x = k;       }     }     vector<int> ans;     for (int i = n; i >= 1; i--) {       ans.push_back(path[i][x].second);       x = path[i][x].first;     }     reverse(ans.begin(), ans.end());     for (int xx : ans) cout << xx <<    ;     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using vi = vector<int>;   using vvi = vector<vector<int>>;   using vl = vector<ll>;   using vvl = vector<vector<ll>>;   using pi = pair<int, int>;   using pl = pair<ll, ll>;   template <typename U>   void print(U arr) {     for (auto element : arr) {       cout << element <<    ;     }     cout <<   n ;   }   void setup(string s) {     freopen((s +  .in ).c_str(),  r , stdin);     freopen((s +  .out ).c_str(),  w , stdout);   }   const int M = 1e9 + 7;   const int mxN = 1e5 + 1;   vvi adj(mxN);   vi lvl(mxN, 0), sub(mxN, 0);   int getSize(int i, int p) {     sub[i] = 1;     for (auto& e : adj[i]) {       if (e != p && !lvl[e]) {         sub[i] += getSize(e, i);       }     }     return sub[i];   }   ll centroid(int i, int p, int n) {     for (auto& e : adj[i]) {       if (e != p && !lvl[e] && sub[e] > n / 2) return centroid(e, i, n);     }     return i;   }   ll decomp(ll i, ll l) {     ll cent = centroid(i, -1, getSize(i, -1));     lvl[cent] = l;     for (ll j : adj[cent])       if (!lvl[j]) decomp(j, l + 1);     return cent;   }   int main(void) {     ios::sync_with_stdio(false);     cin.tie(0);     int n;     cin >> n;     for (ll _ = 0; _ < n - 1; _++) {       int a, b;       cin >> a >> b;       adj[a].push_back(b);       adj[b].push_back(a);     }     decomp(1, 1);     for (ll i = 1; i < n + 1; i++) cout << (char)( A  + lvl[i] - 1) <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s;   int l, r;   inline void get() {     l = 1;     r = 2;     printf( ? %d %d n , l, r);     fflush(stdout);     cin >> s;     while (s[0] ==  y ) {       l <<= 1;       r <<= 1;       printf( ? %d %d n , l, r);       fflush(stdout);       cin >> s;     }   }   int main() {     int mid;     while (1) {       cin >> s;       if (s[0] ==  e ) {         return 0;       }       get();       while (l + 1 < r) {         mid = l + r >> 1;         printf( ? %d %d n , l, mid);         fflush(stdout);         cin >> s;         if (s[0] ==  x )           r = mid;         else           l = mid;       }       printf( ? %d %d n , 0, l);       fflush(stdout);       cin >> s;       if (s[0] ==  x )         printf( ! %d n , l), fflush(stdout);       else         printf( ! %d n , r), fflush(stdout);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};   int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};   char mat[105][105];   int n, m;   int main() {     scanf( %d %d , &n, &m);     for (int i = 0; i < n; i++) {       scanf(  %s , mat[i]);     }     int flag = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (mat[i][j] ==  * ) continue;         int cnt = 0;         for (int k = 0; k < 8; k++) {           if (i + dx[k] < 0 || j + dy[k] < 0 || i + dx[k] >= n || j + dy[k] >= m)             continue;           if (mat[i + dx[k]][j + dy[k]] ==  * ) cnt++;         }         int koto;         if (mat[i][j] ==  . )           koto = 0;         else           koto = mat[i][j] -  0 ;         if (cnt != koto) flag = 1;       }     }     if (flag == 1) {       cout <<  NO  << endl;     } else       cout <<  YES  << endl;   }
#include <bits/stdc++.h>   using namespace std;   string s;   void rd() {     cin >> s;     if (s !=  start ) exit(0);   }   int q(int x, int y) {     cout <<  ?   << x <<     << y << endl;     cin >> s;     if (s[0] ==  x ) return 1;     if (s[0] ==  y ) return 0;     exit(0);   }   int main() {     int i, l, r;     while (1) {       rd();       if (q(0, 1)) {         cout <<  !   << 1 << endl;         continue;       }       for (i = 1; 1; i <<= 1)         if (q(i, i + i)) break;       for (l = i + 1, r = i + i; l < r;) {         i = ((long long)l + r) / 2;         if (q(i, r))           l = i + 1;         else           r = i;       }       cout <<  !   << l << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int cna, cnb;   bool isha[108];   bool ishb[108];   bool vis[108];   int main() {     cin >> n >> m;     cin >> cna;     int tmp;     for (int i = 0; i < cna; i++) {       scanf( %d , &tmp);       isha[tmp] = 1;     }     cin >> cnb;     for (int i = 0; i < cnb; i++) {       scanf( %d , &tmp);       ishb[tmp] = 1;     }     for (int i = 0; i < n; i++) {       if (!isha[i]) continue;       int x = i % m;       vis[x] = 1;       ishb[x] = 1;       tmp = 0;       while (true) {         tmp = (tmp + n) % m;         x = (i + tmp) % m;         if (vis[x]) break;         vis[x] = 1;         ishb[x] = 1;       }     }     memset(vis, 0, sizeof vis);     for (int i = 0; i < m; i++) {       if (!ishb[i]) continue;       int x = i % n;       isha[x] = 1;       vis[x] = 1;       tmp = 0;       while (true) {         tmp = (tmp + m) % n;         x = (i + tmp) % n;         if (vis[x]) break;         vis[x] = 1;         isha[x] = 1;       }     }     memset(vis, 0, sizeof vis);     for (int i = 0; i < n; i++) {       if (!isha[i]) continue;       int x = i % m;       vis[x] = 1;       ishb[x] = 1;       tmp = 0;       while (true) {         tmp = (tmp + n) % m;         x = (i + tmp) % m;         if (vis[x]) break;         vis[x] = 1;         ishb[x] = 1;       }     }     memset(vis, 0, sizeof vis);     for (int i = 0; i < m; i++) {       if (!ishb[i]) continue;       int x = i % n;       isha[x] = 1;       vis[x] = 1;       tmp = 0;       while (true) {         tmp = (tmp + m) % n;         x = (i + tmp) % n;         if (vis[x]) break;         vis[x] = 1;         isha[x] = 1;       }     }     bool flag = 0;     for (int i = 0; i < n; i++) {       if (!isha[i]) {         cout <<  No  << endl;         return 0;       }     }     for (int i = 0; i < m; i++) {       if (!ishb[i]) {         cout <<  No  << endl;         return 0;       }     }     cout <<  Yes  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 310;   int g[maxn][maxn];   int best[maxn];   int a[maxn];   int ans[maxn];   int main() {     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++) {         int v;         scanf( %d , &v);         g[i][v] = j;       }     }     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       best[i] = 1000;     }     for (int i = 1; i <= n; i++) {       int cura = -1;       int curb = -1;       for (int j = 1; j <= n; j++)         if (a[j] <= i) {           cura = a[j];           break;         }       for (int j = 1; j <= n; j++)         if (cura != a[j] && a[j] <= i) {           curb = a[j];           break;         }       for (int j = 1; j <= n; j++) {         int cur = cura;         if (cura == j) cur = curb;         if (cur == -1) continue;         if (g[j][cur] < best[j]) {           best[j] = g[j][cur];           ans[j] = i;         }       }     }     for (int i = 1; i <= n; i++) {       printf( %d , ans[i]);       if (i != n)         printf(   );       else         printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, a[300010], cnt, fa[300010], siz[300010], ans;   bool tag[300010];   inline int find(int x) {     while (x ^ fa[x]) x = fa[x] = fa[fa[x]];     return x;   }   inline void merge(int x, int y) {     x = find(x), y = find(y);     if (x ^ y) fa[x] = y, siz[y] += siz[x];   }   int main() {     printf( 1  );     scanf( %d , &n);     for (int i = 1; i <= n; i++) fa[i] = i, siz[i] = 1;     for (int i = 1; i <= n; i++) {       int p;       scanf( %d , &p);       if (a[p - 1]) {         merge(p, p - 1);       }       if (a[p + 1]) {         merge(p, p + 1);       }       a[p] = 1;       printf( %d  , a[n] ? i - siz[find(n)] + 1 : i + 1);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n, k, i;     cin >> n >> k;     if (n % (2 * k + 1) == 0) {       cout << n / (2 * k + 1) <<   n ;       for (i = k + 1; i <= n; i += (2 * k + 1)) cout << i <<    ;     } else if (n % (2 * k + 1) < (k + 1)) {       cout << n / (2 * k + 1) + 1 <<   n ;       for (i = 1; i <= n; i += (2 * k + 1)) cout << i <<    ;     } else {       cout << n / (2 * k + 1) + 1 <<   n ;       for (i = k + 1; i <= n; i += (2 * k + 1)) cout << i <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 3e5 + 7, mod = 998244353, inf = 1e18, MAXN = 1e6 + 7;   const double eps = 1e-9;   mt19937 rnd(time(0));   long long n;   long long cnt[maxn];   struct state {     long long a, b, d;     state(long long a, long long b, long long d) : a(a), b(b), d(d) {}     state() : a(0), b(0), d(0) {}   };   vector<state> have;   bool cmp(state p1, state p2) { return p1.d > p2.d; }   vector<long long> gr[maxn];   vector<long long> step[maxn];   void solve() {     cin >> n;     for (long long i = 1; i <= n; ++i) {       long long d;       cin >> d;       long long a = 2 * i;       long long b = a - 1;       have.emplace_back(b, a, d);     }     sort(have.begin(), have.end(), cmp);     vector<long long> even;     for (auto v : have) {       even.push_back(v.a);     }     for (long long i = 1; i < n; ++i) {       gr[even[i - 1]].push_back(even[i]);     }     long long size = n;     for (long long i = 0; i < n; ++i) {       --size;       long long d = have[i].d;       long long b = have[i].b;       if (size < d) {         gr[even.back()].push_back(b);         even.push_back(b);         ++size;       } else {         gr[even[i + d - 1]].push_back(b);       }     }     for (long long i = 1; i <= 2 * n; ++i) {       for (auto v : gr[i]) {         cout << i <<     << v <<   n ;       }     }   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.precision(20);     cout << fixed;     long long t = 1;     for (long long i = 0; i < t; ++i) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t = 1;     while (t--) {       long long n;       cin >> n;       long long a[n];       for (int i = 0; i < n; i++) cin >> a[i];       if (n == 1) {         cout <<  1 1  << endl;         cout <<  0  << endl;         cout <<  1 1  << endl;         cout << 0 << endl;         cout <<  1 1  << endl;         cout << -a[0] << endl;       } else {         cout <<  1 1  << endl;         cout << -a[0] << endl;         cout <<  2               <<     << n << endl;         for (int i = 1; i < n; i++) {           cout << a[i] * (n - 1) <<    ;         }         cout << endl;         cout <<  1               <<     << n << endl;         cout <<  0  ;         for (int i = 1; i < n; i++) cout << -a[i] * n <<    ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   struct pt {     int x, y;   };   int h, t, r, n, m;   int w[205][205], unc[205][205], siofdjsodi[205][205];   basic_string<pt> e[205][205], f[205][205], qu;   pt hd[205], td[205];   void ae(int i, int j, int u, int v) {     if (u + v > r) return;     e[i][j] += {u, v};     f[u][v] += {i, j};     unc[i][j]++;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     cerr.tie(nullptr);     cin >> h >> t >> r;     cin >> n;     for (int i = 1; i <= n; i++) cin >> hd[i].x >> hd[i].y;     cin >> m;     for (int i = 1; i <= m; i++) cin >> td[i].x >> td[i].y;     for (int i = 0; i <= r; i++) {       for (int j = 0; i + j <= r; j++) {         for (int x = 1; x <= min(i, n); x++) {           int u = i - x + hd[x].x;           int v = j + hd[x].y;           ae(i, j, u, v);         }         for (int y = 1; y <= min(j, m); y++) {           int u = i + td[y].x;           int v = j - y + td[y].y;           ae(i, j, u, v);         }       }     }     {       w[0][0] = 1;       qu += pt{0, 0};       size_t qs = 0;       while (qs != qu.size()) {         auto [i, j] = qu[qs++];         for (auto [x, y] : f[i][j]) {           if (w[x][y] == 0) {             w[x][y] = 1;             siofdjsodi[x][y] = siofdjsodi[i][j] + 1;             qu += {x, y};           }         }       }     }     qu = {};     for (int i = 0; i <= r; i++) {       for (int j = 0; i + j <= r; j++) {         if (w[i][j] == 0 && unc[i][j] == 0) {           qu += {i, j};         }       }     }     size_t qs = 0;     while (qs != qu.size()) {       auto [i, j] = qu[qs++];       int q = 0;       for (auto [x, y] : e[i][j]) {         q = max(q, siofdjsodi[x][y]);       }       w[i][j] = -1;       siofdjsodi[i][j] = q + 1;       for (auto [x, y] : f[i][j]) {         if (!--unc[x][y]) {           qu += {x, y};         }       }     }     if (w[h][t] == 1) {       cout <<  Ivan n ;       cout << siofdjsodi[h][t] <<   n ;     } else if (w[h][t] == -1) {       cout <<  Zmey n ;       cout << siofdjsodi[h][t] <<   n ;     } else {       cout <<  Draw n ;     }   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   const int inf = 1e9 + 7;   const long long linf = 1e18;   const double pi = acos(-1.0);   int main() {     ios::sync_with_stdio(false);     int t;     cin >> t;     for (int total = 0; total < t; total++) {       int n, p;       cin >> n >> p;       for (int temp = 0; temp < 2 * n + p;) {         for (int i = 1; i <= n; i++) {           if (temp == 2 * n + p) break;           for (int j = i + 1; j <= n; j++) {             temp++;             cout << i <<     << j << endl;             if (temp == 2 * n + p) break;           }         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   long long ksm(long long a, long long b) {     long long res = 1;     a %= mod;     assert(b >= 0);     for (; b; b >>= 1) {       if (b & 1) res = res * a % mod;       a = a * a % mod;     }     return res;   }   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   const int N = 1e5;   int n, t, p[N], pos[N], tmp[N];   int main() {     scanf( %d , &t);     while (t--) {       scanf( %d , &n);       for (int i = 1; i <= n; i++) {         scanf( %d , &p[i]);         tmp[i] = 0;         pos[p[i]] = i;       }       bool f = false;       for (int i = 1; i <= n; i++) {         if (tmp[pos[i]]) {           continue;         } else {           tmp[pos[i]] = i;           int x = i + 1;           for (int j = pos[i] + 1, x = i + 1; j <= n; j++) {             if (tmp[j]) break;             tmp[j] = x++;           }           i = x - 1;         }       }       for (int i = 1; i <= n; i++) {         if (p[i] == tmp[i]) continue;         f = true;         break;       }       if (f)         puts( NO );       else         puts( YES );     }     return 0;   }