malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 200004, M = 19;   vector<int> g[N];   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   int d[N], fa[N][M], n;   long long w[N][M], a[N], mod = 1000000007;   void bfs() {     d[1] = 1;     for (int i = 0; i < M; i++) w[1][i] = a[1];     queue<int> q;     q.push(1);     while (!q.empty()) {       int u = q.front();       q.pop();       for (int v : g[u]) {         if (d[v]) continue;         d[v] = d[u] + 1;         fa[v][0] = u;         w[v][0] = a[v];         for (int i = 1; i < M; i++) {           fa[v][i] = fa[fa[v][i - 1]][i - 1];           w[v][i] = gcd(w[v][i - 1], w[fa[v][i - 1]][i - 1]);         }         q.push(v);       }     }   }   int main() {     int x, y;     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %lld , &a[i]);     for (int i = 1; i < n; i++) {       scanf( %d %d , &x, &y);       g[x].push_back(y);       g[y].push_back(x);     }     bfs();     long long ans = 0;     for (int i = 1; i <= n; i++) {       long long nw = a[i];       int pre = d[i];       for (;;) {         int v = i;         for (int j = M - 1; j >= 0; j--)           if (w[v][j] == 0) v = fa[v][j];         for (int j = M - 1; j >= 0; j--)           if (gcd(nw, w[v][j]) == nw) v = fa[v][j];         ans = (ans + nw * (pre - d[v])) % mod;         if (v == 0) break;         nw = gcd(nw, a[v]);         pre = d[v];       }     }     printf( %lld n , ans);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int mera[100001];     int snct[100001];     string s;     cin >> s;     int len = s.length();     stack<int> st;     if (s[0] ==  [ ) {       snct[0] = 1;     } else {       snct[0] = 0;     }     for (int i = 1; i < len; i++) {       snct[i] = snct[i - 1];       if (s[i] ==  [ ) {         snct[i]++;       }     }     for (int i = 0; i < len; i++) {       mera[i] = -1;       if (s[i] ==  (  || s[i] ==  [ ) {         st.push(i);       } else if (s[i] ==  ) ) {         if (!st.empty()) {           int h = st.top();           if (h != -1 && s[h] ==  ( ) {             mera[i] = h;             st.pop();           } else {             st.push(-1);           }         }       } else {         if (!st.empty()) {           int h = st.top();           if (h != -1 && s[h] ==  [ ) {             mera[i] = h;             st.pop();           } else {             st.push(-1);           }         }       }     }     for (int i = 0; i < len; i++) {       if (mera[i] != -1 && mera[i] > 0 && mera[mera[i] - 1] != -1) {         mera[i] = mera[mera[i] - 1];       }     }     int max = 0;     int x = -1;     for (int i = 0; i < len; i++) {       if (mera[i] != -1) {         int c = snct[i];         if (mera[i] > 0) c -= snct[mera[i] - 1];         if (c > max) {           x = i;           max = c;         }       }     }     cout << max << endl;     if (max > 0) cout << s.substr(mera[x], x - mera[x] + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     int n;     cin >> n;     int a[n], g[n];     int sa = 0, sg = 0;     char ans[n];     for (int i = 0; i < n; ++i) {       cin >> a[i] >> g[i];     }     for (int i = 0; i < n; ++i) {       sa += a[i];       if (sa <= 500) {         ans[i] =  A ;       } else if (sa > 500) {         sa -= 1000;         ans[i] =  G ;       } else {         cout <<  -1 ;         return 0;       }     }     for (int i = 0; i < n; ++i) {       cout << ans[i];     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1000000007;   const int INF = MOD;   vector<int> a[200];   int cnt = 0;   bool used[200];   void dfs(int v) {     used[v] = true;     for (int i = 0; i < a[v].size(); i++)       if (!used[a[v][i]]) dfs(a[v][i]);   }   bool flag = false;   vector<pair<int, int> > ans;   int main() {     std::ios_base::sync_with_stdio(false);     int n, m;     cin >> n >> m;     if (m == 3 && (n == 5 || n == 6)) {       cout << -1 << endl;       return 0;     }     if (m == 3 && n == 4) {       cout << -1 <<     << 0 << endl;       cout << 0 <<     << 0 << endl;       cout << 1 <<     << 1 << endl;       cout << 1 <<     << -1 << endl;       return 0;     }     int cnt = n;     for (int i = 0; i < m; i++, cnt--) cout << i <<     << i * i << endl;     for (int i = 0, x = 4 * m * m; cnt > 0; i++, cnt--, x--)       cout << x <<     << m * m - i * i << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     string s;     cin >> s;     vector<long long> cnt(26);     long long posl = 1e9, posr = 0;     for (auto c : s) {       cnt[c -  a ]++;       posl = min(posl, (long long)(c -  a ));       posr = max(posr, (long long)(c -  a ));     }     for (long long i = posl; i <= posr; i++) {       if (cnt[i] != 1) {         cout <<  No n ;         return;       }     }     cout <<  Yes n ;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cout << fixed;     cout.precision(30);     long long t = 1;     cin >> t;     while (t--) solve();   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const long long N = 1e6 + 5;   long long solve() {     long long n;     cin >> n;     map<long long, long long> mp;     vector<long long> v(n);     for (long long &x : v) {       cin >> x;       mp[x]++;     }     long long ans = 0;     for (auto it : mp) {       long long usable = (long long)mp.size() - 1;       long long use = min(usable, it.second);       if (it.second > usable + 1) {         ++use;       }       ans = max(ans, use);     }     cout << ans <<   n ;     return 0;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     long long T = 1;     cin >> T;     for (long long i = 1; i <= T; ++i) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1000000000;   const double EPS = 1e-9;   int n, m, t[210][210], d[210][210];   bool active[210];   vector<pair<int, int> > x_sorted;   double calc(int x, int y) {     double ans = INF;     vector<pair<int, int> > s;     multiset<int> up;     int down = -INF;     for (int i = 1; i <= n; i++) {       int tmp = t[x][y] + d[y][i] - d[x][i];       active[i] = false;       if (tmp < 0)         down = max(down, t[x][y] + d[y][i]);       else if (tmp > 2 * t[x][y]) {         active[i] = true;       } else {         s.push_back(make_pair(tmp, i));         active[i] = true;       }     }     active[0] = true;     s.push_back(make_pair(0, -1));     s.push_back(make_pair(2 * t[x][y], -1));     sort(s.begin(), s.end());     int _x_sorted = 0;     for (int i = 0; i + 1 < s.size(); i++) {       if (s[i].second > -1) {         active[s[i].second] = false;         down = max(down, t[x][y] + d[y][s[i].second]);       }       while (!active[x_sorted[_x_sorted].second]) ++_x_sorted;       int up_best = x_sorted[_x_sorted].first;       int z = down - up_best;       z = max(s[i].first, z);       z = min(s[i + 1].first, z);       ans = min(ans, max(up_best + 0.5 * z, down - 0.5 * z));     }     return ans;   }   int main() {     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) t[i][j] = INF;     while (m--) {       int x, y, z;       scanf( %d %d %d , &x, &y, &z);       t[x][y] = t[y][x] = z;     }     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++) d[i][j] = i == j ? 0 : t[i][j];     for (int k = 1; k <= n; k++)       for (int i = 1; i <= n; i++)         for (int j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);     double ans = INF;     for (int i = 1; i <= n; i++) {       x_sorted.clear();       for (int j = 1; j <= n; j++) x_sorted.push_back(make_pair(d[i][j], j));       x_sorted.push_back(make_pair(-1, 0));       sort(x_sorted.begin(), x_sorted.end());       reverse(x_sorted.begin(), x_sorted.end());       for (int j = 1; j < i; j++) ans = min(ans, calc(i, j));     }     printf( %.9lf n , ans);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int n, m;     cin >> n >> m;     for (int i = 1; i < n + 1; i++) {       for (int j = 1; j < m + 1; j++) {         if (i % 4 == 2) {           if (j == m) {             cout <<  # ;           } else {             cout <<  . ;           }         } else if (i % 4 == 0) {           if (j == 1) {             cout <<  # ;           } else {             cout <<  . ;           }         } else {           cout <<  # ;         }       }       cout <<   n ;     }     return 0;   }
/** try <3 **/      #include<bits/stdc++.h>      using namespace std;      #define task  sol    #define lb lower_bound   #define ub upper_bound   #define fi first   #define se second   #define pb push_back   #define mp make_pair   #define zs(v) ((int)(v).size())   #define BIT(x, i) (((x) >> (i)) & 1)   #define CNTBIT __builtin_popcountll   #define ALL(v) (v).begin(),(v).end()   #define endl   n       typedef long double ld;   typedef long long ll;   typedef pair<int,int> pii;      void gogo()   {       int x;       cin>>x;          ll s=0, ans=0;          for(int i=1;i<=x;++i)       {           s+=i;           ans=i;           if(s>=x) break;       }          if(!(s==x||s>x+1)) ++ans;       cout<<ans<<  n ;   }   int main()   {       ios_base::sync_with_stdio(0); cin.tie(0);       if(fopen(task .inp , r ))       {           freopen(task .inp , r ,stdin);           freopen(task .out , w ,stdout);       }       int t;       cin>>t;       while(t--) gogo();       return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, a[60], b[60];     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     cin >> m;     for (int i = 0; i < m; i++) cin >> b[i];     int BG = -1;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (!(b[j] % a[i])) {           if (b[j] / a[i] > BG) {             BG = b[j] / a[i];           }         }       }     }     int ans = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (!(b[j] % a[i]) && b[j] / a[i] == BG) {           ans++;         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int Max = 1000000100;   vector<long long> s;   void dfs(long long temp) {     if (temp > Max) {       return;     }     long long x = temp * 10 + 4;     if (temp > Max) {       return;     }     s.push_back(x);     dfs(x);     long long y = temp * 10 + 7;     if (temp > Max) {       return;     }     s.push_back(y);     dfs(y);   }   int main() {     dfs(0);     s.push_back(0);     sort(s.begin(), s.end());     long long l, r, x, y;     int n;     cin >> l >> r >> x >> y >> n;     long long temp = l > x ? x : l;     int i = lower_bound(s.begin(), s.end(), temp) - s.begin();     double sum = 0;     while (true) {       long long a = s[i - 1] + 1;       long long b = s[i];       long long c = s[i + n - 1];       long long d = s[i + n] - 1;       if (a > r && a > y) break;       if (c > r && c > y) break;       long long A = a > l ? a : l;       long long B = b < r ? b : r;       long long C = c > x ? c : x;       long long D = d < y ? d : y;       int shabi;       int z = 0;       if (n == 1 && B == C) {         int o = lower_bound(s.begin(), s.end(), B) - s.begin();         if (s[o] == B) z = 1;       }       if (z) shabi = D;       if (A <= B && C <= D) {         if (z)           sum += (double)(B - A) / (double)(r - l + 1) * (double)(D - C + 1) /                  (double)(y - x + 1);         else           sum += (double)(B - A + 1) / (double)(r - l + 1) * (double)(D - C + 1) /                  (double)(y - x + 1);       }       A = a > x ? a : x;       B = b < y ? b : y;       C = c > l ? c : l;       D = d < r ? d : r;       if (A <= B && C <= D) {         if (z)           sum += (double)(B - A + 1) / (double)(y - x + 1) * (double)(D - C) /                  (double)(r - l + 1);         else           sum += (double)(B - A + 1) / (double)(y - x + 1) * (double)(D - C + 1) /                  (double)(r - l + 1);       }       if (z) {         sum += (double)(shabi - A + 1) / (double)(y - x + 1) * (double)(1) /                (double)(r - l + 1);       }       i++;     }     printf( %.12lf , sum);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long fact[1000001], power[1000001];   long long powerr(long long x, long long y);   long long mpower(long long x, long long y, long long p);   long long gcdExtended(long long a, long long b);   bool isPrime(long long n);   long long func(long long n) {     long long x = sqrt(n);     if (n % x == 0) x = x + 1;     long long i;     for (i = 2; i < n / 2; i++) {       if (n % i == 0 && isPrime(i) == true) {         return i;       }     }     return n;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long t, j, k, l, h, p, q, r, x, i, y, z, a, b, c, d, f, n, m,         M = 1000000007;     char ch, ch2, ch3;     string s1, s2, s3;     vector<long long> v, w;     set<long long> S;     t = 1;     while (t--) {       cin >> n >> m >> x >> y;       cout << x <<     << y;       cout <<   n ;       z = 0;       for (j = x - 1; j < n; j++) {         if (z == 0) {           for (k = z; k < m; k++) {             if (j == x - 1 && k == y - 1)               continue;             else {               cout << j + 1 <<     << k + 1;               cout <<   n ;             }           }           z = m - 1;         } else {           for (k = m - 1; k >= 0; k--) {             if (j == x - 1 && k == y - 1)               continue;             else {               cout << j + 1 <<     << k + 1;               cout <<   n ;             }           }           z = 0;         }       }       for (j = x - 2; j >= 0; j--) {         if (z == 0) {           for (k = z; k < m; k++) {             if (j == x - 1 && k == y - 1)               continue;             else {               cout << j + 1 <<     << k + 1;               cout <<   n ;             }           }           z = m - 1;         } else {           for (k = m - 1; k >= 0; k--) {             if (j == x - 1 && k == y - 1)               continue;             else {               cout << j + 1 <<     << k + 1;               cout <<   n ;             }           }           z = 0;         }       }     }   }   long long gcdExtended(long long a, long long b) {     if (b == 0) {       return a;     } else       return gcdExtended(b, a % b);   }   long long mpower(long long x, long long y, long long p) {     long long res = 1;     x = x % p;     while (y > 0) {       if (y & 1) res = (res * x) % p;       y = y >> 1;       x = (x * x) % p;     }     return res;   }   long long powerr(long long x, long long y) {     long long res = 1;     while (y > 0) {       if (y & 1) res = res * x;       y = y >> 1;       x = x * x;     }     return res;   }   bool isPrime(long long n) {     if (n <= 1) return false;     if (n <= 3) return true;     if (n % 2 == 0 || n % 3 == 0) return false;     long long p = sqrt(n);     for (int i = 5; i <= p; i = i + 6)       if (n % i == 0 || n % (i + 2) == 0) return false;     return true;   }
#include <bits/stdc++.h>   using namespace std;   int gcd(int a, int b) {     if (a < b) {       int temp;       temp = a;       a = b;       b = temp;     }     while (a % b) {       int r = a % b;       a = b;       b = r;       r = a % b;     }     return b;   }   int fun(int a, int n) {     int sum = 0;     for (;;) {       sum = sum + a % n;       a = a / n;       if (a == 0) break;     }     return sum;   }   int main() {     int i, j, m, n, a, qum = 0;     while (scanf( %d , &a) != EOF) {       for (i = 2; i <= (a - 1); i++) {         qum += fun(a, i);       }       m = gcd(qum, a - 2);       qum = qum / m;       a = (a - 2) / m + 2;       printf( %d/%d n , qum, a - 2);       qum = 0;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     while (cin >> n >> m) {       vector<int> f(n);       vector<int> v[100005];       vector<int> b(m);       vector<int> a(m);       vector<int> used(100005, 0);       for (int i = 0; i < n; i++) {         cin >> f[i];         v[f[i]].push_back(i + 1);       }       for (int i = 0; i < m; i++) cin >> b[i];       int sizeA = 0;       int state = -1;       for (int i = 0; i < m; i++) {         if (v[b[i]].size()) {           a[sizeA++] = v[b[i]][0];           used[b[i]]++;         } else {           sizeA = 0;           break;         }       }       if (sizeA < m) {         cout <<  Impossible  << endl;         continue;       }       for (int i = 0; i < 100005 && state == -1; i++) {         if (used[i] && v[i].size() > 1) {           state = 1;         }       }       if (state == 1 || sizeA > m) {         cout <<  Ambiguity  << endl;       } else {         cout <<  Possible  << endl;         for (int i = 0; i < m; i++) {           if (i) cout <<    ;           cout << a[i];         }         cout << endl;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int N;     cin >> N;     string A, B;     cin >> A >> B;     int ans = 0;     for (int x = 0; x < N - 1 - x; x++) {       vector<char> v;       v = {A[x], A[N - 1 - x], B[x], B[N - 1 - x]};       sort(v.begin(), v.end());       if (v[0] == v[1] && v[2] == v[3]) continue;       if ((v[0] == v[1] && v[1] == v[2]) || (v[1] == v[2] && v[2] == v[3])) {         ans++;         continue;       }       bool flag = true;       for (int y = 1; y < 4; y++)         if (v[y] == v[y - 1] && A[x] != A[N - 1 - x]) {           cerr << v[y] <<     << v[y - 1] << endl;           ans++;           flag = false;           break;         }       if (flag) ans += 2;     }     if (N % 2 && A[N / 2] != B[N / 2]) ans++;     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1000000007;   int n, c1, c2;   int a[10];   long long f[501];   long long c[501][501];   long long dp[501][501];   long long gao(int a, int b) {     if (a == 0 && b == 0) {       return 1;     }     if (dp[a][b] == -1) {       long long& cur = dp[a][b] = 0;       if (a > 0) {         if (a >= 1) {           for (int i = 0; i <= b; ++i) {             cur = (cur + gao(a - 1, b - i) * c[b][i] % MOD * f[i]) % MOD;           }         }         if (a >= 2) {           for (int i = 0; i <= b; ++i) {             cur = (cur +                    gao(a - 2, b - i) * c[b][i] % MOD * (a - 1) % MOD * f[i + 1]) %                   MOD;           }         }       } else {         for (int i = 0; i < b; ++i) {           cur = (cur + gao(a, b - i - 1) * c[b - 1][i] % MOD * f[i]) % MOD;         }       }     }     return dp[a][b];   }   int main() {     for (int i = f[0] = 1; i <= 500; ++i) {       f[i] = f[i - 1] * i % MOD;     }     for (int i = 0; i <= 500; ++i) {       c[i][0] = c[i][i] = 1;       for (int j = 1; j < i; ++j) {         c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;       }     }     c1 = c2 = 0;     scanf( %d , &n);     for (int i = 0; i < n; ++i) {       scanf( %d , &a[i]);       ++(a[i] == 1 ? c1 : c2);     }     memset(dp, -1, sizeof(dp));     int res = gao(c1, c2) % MOD;     printf( %d n , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const int N = 10e6 + 6;   int p[N];   int nx[N];   int n;   priority_queue<int> r;   bool vis[N];   int main(void) {     ios::sync_with_stdio(false);     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> p[i];       nx[p[i] - 1] = i;     }     r.push(1);     for (int i = 1; i <= n; i++) {       if (!vis[i]) {         vis[i] = true;         if (nx[p[i]] > i and nx[p[i]] > 0 and nx[p[i]] <= n) {           int j = nx[p[i]];           int ct = 2;           while (nx[p[j]] > j and nx[p[j]] > 0 and nx[p[j]] <= n) {             vis[j] = true;             j = nx[p[j]];             ct++;           }           r.push(ct);         }       }     }     memset(vis, false, sizeof(vis));     cout << n - r.top() << endl;     return 0;   }
#include <bits/stdc++.h>   const int S = 103;   int n, m, a[S], b[S];   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) {       if (2 * n + 2 * (i - 1) + 1 <= m) printf( %d  , 2 * n + 2 * (i - 1) + 1);       if (2 * i - 1 <= m) printf( %d  , 2 * i - 1);       if (2 * (n + i) <= m) printf( %d  , 2 * (n + i));       if (2 * i <= m) printf( %d  , 2 * i);     }     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:16777216 )   #pragma warning(disable : 4786)   using namespace std;   int MIN(int a, int b) { return a < b ? a : b; }   int MAX(int a, int b) { return a > b ? a : b; }   int GCD(int a, int b) {     while (b) b ^= a ^= b ^= a %= b;     return a;   }   int LCM(int a, int b) { return a * (b / GCD(a, b)); }   void SWAP(int &a, int &b) {     a = a ^ b;     b = a ^ b;     a = a ^ b;   }   const double PI = acos(-1);   const double ESP = 1e-11;   int arr[100100], brr[100010], crr[100010];   int main() {     int ind, i, j, N, T, result, cnt, counter, temp, temp1, idx, index, a, b, c,         d, e, f, g, h, n, m, k;     memset(crr, -1, sizeof(crr));     while (scanf( %d , &n) != EOF) {       for (i = 0; i < n; i++) {         counter = 0;         scanf( %d%d , &a, &e);         b = a;         c = sqrt(b);         memset(brr, NULL, sizeof(brr));         cnt = 0;         {           for (j = 1; j <= c; j++) {             f = j;             g = b / j;             if (b % f == 0) {               if (crr[f] == -1 || crr[f] < i - e) {                 counter += 1;               }               if (f != g && (crr[g] == -1 || crr[g] < i - e)) {                 counter += 1;               }               crr[f] = i;               if (b % g == 0) {                 crr[g] = i;               }             }           }           f = b;           if (crr[f] == -1 || crr[f] < i - e) {             crr[f] = i;             counter += 1;           }           printf( %d n , counter);         }       }       memset(arr, NULL, sizeof(arr));     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e3 + 555;   int n, m;   int a[maxn], b[maxn];   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) scanf( %d , a + i);     for (int i = 1; i <= m; i++) scanf( %d , b + i);     int i1 = 1, i2 = 1;     int res = 0;     while (i1 <= n && i2 <= m) {       if (a[i1] <= b[i2])         i1++, i2++, res++;       else         i1++;     }     printf( %d n , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int q, r, g, b, w;     cin >> q;     while (q--) {       vector<int> a(4);       int odd = 0, even = 0;       for (int i = 0; i < 4; i++) {         cin >> a[i];         if (a[i] % 2)           odd += 1;         else           even += 1;       }       if (odd <= 1)         cout <<  YES n ;       else {         if (min(a[0], min(a[1], a[2])) >= 1) {           odd = 0, even = 0;           for (int i = 0; i < 3; i++) {             a[i] -= 1;             if (a[i] % 2)               odd += 1;             else               even += 1;           }           a[3] += 1;           if (a[3] % 2)             odd += 1;           else             even += 1;           if (odd <= 1)             cout <<  YES n ;           else             cout <<  NO n ;         } else {           cout <<  NO n ;         }       }     }   }