malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   vector<string> s(100, string(100,  . ));   int n, k;   int solve() {     ios::sync_with_stdio(false), cin.tie(0);     cin >> n >> k;     if (n - 2 == k) {       for (int i = 1; i < n - 1; i++) {         s[1][i] =  # ;       }       return 1;     }     if (k % 2 == 0) {       for (int j = 0; j < n; j++) {         for (int i = 0; i < 4; i++) {           if (i != 0 && i != 3 && j != 0 && j != n - 1 && k) {             s[i][j] =  # ;             k--;           }         }       }       return 1;     }     if (k >= 5) {       s[1][1] =  # ;       s[2][1] =  # ;       k -= 2;       for (int i = 2; i < n - 2; i++) {         s[1][i] =  # ;         k--;         if (k == 2) {           s[1][i + 1] = s[2][i + 1] =  # ;           return 1;         }       }       s[1][n - 2] = s[2][n - 2] =  # ;       k -= 2;       for (int i = 2; i < n - 2; i++) {         s[2][i] =  # ;         k--;         if (k == 0) return 1;       }     }     if (k == 3) {       s[1][n / 2 + 1] = s[2][n / 2] = s[1][n / 2 - 1] =  # ;       return 1;     }     if (k == 1) {       s[2][n / 2] =  # ;       return 1;     }     assert(0);   }   int main() {     int t = solve();     if (!solve()) return (cout <<  NO  << endl, 0);     cout <<  YES  << endl;     for (int i = 0; i < 4; i++) {       for (int j = 0; j < n; j++) {         cout << s[i][j];       }       cout << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   void hashLine(int n) {     for (int i = 0; i < n; i++) cout <<  # ;     cout << endl;   }   void right(int n) {     cout <<  . ;     for (int i = 1; i < n - 1; i++) cout <<  . ;     cout <<  # n ;   }   void left(int n) {     cout <<  # ;     for (int i = 1; i < n - 1; i++) cout <<  . ;     cout <<  . n ;   }   int main() {     int n, m, i, j, dir = 0;     cin >> n >> m;     for (i = 0; i < n; i++) {       if (i % 2 == 0)         hashLine(m);       else {         if (dir == 0) {           right(m);           dir = 1;         } else {           left(m);           dir = 0;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool a[1000009];   int main() {     int n, x;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> x;       if (x == 1) {         cout <<  -1 ;         return 0;       }       a[x] = 1;     }     for (int i = 1; i <= n; i++) {       if (a[i] == 0) {         cout << i;         return 0;       }     }     cout <<  -1 ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 222222;   unsigned long long p4423[maxn];   struct State {     unsigned long long hashValue;     int count;     void assign(int value) {       if (value == 0) {         hashValue = 0;         count = 0;       } else {         hashValue = value;         count = 1;       }     }     void assign(const State &l, const State &r) {       hashValue = p4423[r.count] * l.hashValue + r.hashValue;       count = l.count + r.count;     }   };   State states[maxn * 2];   int n, m;   int a[maxn], b[maxn];   int pos[maxn];   void update(int l, int r, int p, int v) {     if (l == r) {       if (p == l) {         states[(((l) + (r)) | ((l) != (r)))].assign(v);       }       return;     }     int m = l + r >> 1;     if (p <= m) {       update(l, m, p, v);     }     if (p > m) {       update(m + 1, r, p, v);     }     states[(((l) + (r)) | ((l) != (r)))].assign(         states[(((l) + (m)) | ((l) != (m)))],         states[(((m + 1) + (r)) | ((m + 1) != (r)))]);   }   int main() {     p4423[0] = 1;     for (int i = 1; i < maxn; i++) {       p4423[i] = p4423[i - 1] * 4423;     }     scanf( %d%d , &n, &m);     unsigned long long targetHash = 0, ones = 0;     for (int i = 0; i < n; i++) {       scanf( %d , a + i);       targetHash = targetHash * 4423 + a[i];       ones = ones * 4423 + 1;     }     for (int i = 0; i < m; i++) {       scanf( %d , b + i);       pos[b[i]] = i;     }     for (int i = 1; i < n; i++) {       update(0, m - 1, pos[i], i);     }     int ret = 0;     for (int i = n; i <= m; i++) {       update(0, m - 1, pos[i], i);       assert(states[(((0) + (m - 1)) | ((0) != (m - 1)))].count == n);       if (states[(((0) + (m - 1)) | ((0) != (m - 1)))].hashValue == targetHash) {         ret++;       }       targetHash += ones;       update(0, m - 1, pos[i - n + 1], 0);     }     printf( %d n , ret);   }
#include <bits/stdc++.h>   using namespace std;   signed main() {     long long int t;     cin >> t;     while (t--) {       long long int n;       cin >> n;       long long int a[n];       for (long long int i = 0; i < n; i++) cin >> a[i];       long long int x = a[0];       for (long long int i = n - 1; i > 0; i--) {         a[i] -= a[i - 1];         if (a[i] < 0) x += a[i];       }       if (x >= 0)         cout <<  YES  << endl;       else {         cout <<  NO  << endl;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   vector<pair<long long, int> > vertices;   bool cmp(pair<long long, int> x, pair<long long, int> y) {     return x.first < y.first;   }   bool cmp2(pair<long long, pair<int, int> > x,             pair<long long, pair<int, int> > y) {     return x.first < y.first;   }   int lab[200010];   vector<pair<long long, pair<int, int> > > ed;   void uni(int r1, int r2) {     int x = lab[r1] + lab[r2];     if (lab[r1] < lab[r2]) {       lab[r1] = x;       lab[r2] = r1;     } else {       lab[r2] = x;       lab[r1] = r2;     }   }   int get(int x) {     if (lab[x] < 0) return x;     lab[x] = get(lab[x]);     return lab[x];   }   static int desyncIO = []() {     std::ios::sync_with_stdio(false);     std::cout.tie(nullptr);     std::cin.tie(nullptr);     return 0;   }();   int main() {     ios::sync_with_stdio(false);     memset(lab, -1, sizeof(lab));     cin >> n >> m;     for (int i = 1; i <= n; i++) {       long long x;       cin >> x;       vertices.push_back(make_pair(x, i));     }     sort(vertices.begin(), vertices.end(), cmp);     for (int i = 1; i < n; i++) {       int u = vertices[0].second;       int v = vertices[i].second;       long long w = vertices[0].first + vertices[i].first;       ed.push_back(make_pair(w, make_pair(u, v)));     }     for (int i = 1; i <= m; i++) {       int u, v;       long long w;       cin >> u >> v >> w;       ed.push_back(make_pair(w, make_pair(u, v)));     }     sort(ed.begin(), ed.end(), cmp2);     long long ret = 0;     for (int i = 0; i < ed.size(); i++) {       int u = ed[i].second.first;       int v = ed[i].second.second;       long long w = ed[i].first;       int r1 = get(u);       int r2 = get(v);       if (r1 != r2) {         ret += w;         uni(r1, r2);       }     }     cout << ret;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<string> com;   vector<int> num;   vector<string> adj[1000010];   struct node {     string s;     int i;     node() {}     node(string x, int idx) {       s = x;       i = idx;     }   };   int toNum(string s) {     int i, j, k;     int l = s.length();     k = 1;     j = 0;     for (i = l - 1; i >= 0; i--) {       j += (s[i] - 48) * k;       k *= 10;     }     return j;   }   int jdx, sz;   void solve(node x, int lvl) {     if (lvl >= 0) adj[lvl].push_back(x.s);     if (lvl >= 0 && num[x.i] == 0) return;     while (jdx < sz) {       if (lvl == -1) {         node temp = node(com[jdx], jdx);         jdx++;         solve(temp, lvl + 1);       } else {         while (num[x.i] > 0) {           num[x.i]--;           node temp = node(com[jdx], jdx);           jdx++;           solve(temp, lvl + 1);         }         if (!num[x.i]) return;       }     }   }   int main() {     int i, j, k;     int n, m;     string s, t;     cin >> s;     t =   ;     n = s.length();     for (i = 0; i < n; i++) {       if (s[i] ==  , ) {         if (isdigit(t[0]))           num.push_back(toNum(t));         else           com.push_back(t);         t =   ;       } else {         t += s[i];       }     }     num.push_back(toNum(t));     jdx = 0;     sz = com.size();     node r = node( root , -1);     solve(r, -1);     k = 0;     for (i = 0; i < 1000010; i++) {       if (adj[i].size() > 0)         k++;       else         break;     }     printf( %d n , k);     for (i = 0; i < k; i++) {       m = adj[i].size();       for (j = 0; j < m; j++) cout << adj[i][j] <<    ;       printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, k;     cin >> n;     cin >> m;     cin >> k;     bool done = false;     int num = 0;     int lanes = 0;     int desks = 0;     int d = 0;     while (num < k) {       desks = 0;       done = false;       num += 2 * m;       lanes++;       while (done == false) {         if (d >= num || d >= k) {           done = true;           break;         }         d += 2;         desks++;       }     }     cout << lanes <<     << desks <<    ;     if (k % 2 == 0) {       cout <<  R  << endl;     } else       cout <<  L  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long INF = 0x3f3f3f3f;   const long long MAXN = 3e5 + 5;   long long n, MOD, k, ans;   map<long long, long long> mp;   signed main() {     scanf( %lld%lld%lld , &n, &MOD, &k);     for (long long i = 1; i <= n; i++) {       long long x;       scanf( %lld , &x);       x = (x * x % MOD * x % MOD * x % MOD + MOD - x * k % MOD) % MOD;       mp[x]++;     }     for (map<long long, long long>::iterator it = mp.begin(); it != mp.end();          it++) {       long long x = it->second;       ans += (x - 1) * x / 2;     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long binpow(long long a, long long b) {     a = a % 1000000007;     long long res = 1;     while (b > 0) {       if (b & 1) res *= a % 1000000007;       a = a * a % 1000000007;       b = b >> 1;     }     return res;   }   void speedup() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);   }   int dx[] = {1, -1, 2, 2, -2, -2, 1, -1};   int dy[] = {2, 2, 1, -1, 1, -1, -2, -2};   int bfs(int sx, int sy, int desx, int desy) {     int vis[9][9];     int d[9][9];     for (int i = 1; i <= 8; i++) {       for (int j = 1; j <= 8; j++) {         vis[i][j] = 0;         d[i][j] = 0;       }     }     vis[sx][sy] = 1;     queue<pair<int, int> > q;     q.push(pair<int, int>(sx, sy));     while (!q.empty()) {       pair<int, int> top = q.front();       q.pop();       for (int i = 0; i < 8; i++) {         int tx = top.first + dx[i];         int ty = top.second + dy[i];         if (tx >= 1 && tx <= 8 && ty >= 1 && ty <= 8 && vis[tx][ty] == 0) {           vis[tx][ty] = 1;           d[tx][ty] = d[top.first][top.second] + 1;           q.push(pair<int, int>(tx, ty));         }       }     }     return d[desx][desy];   }   int main() {     speedup();     int n;     cin >> n;     int a[n], l[n], r[n];     for (int i = 0; i < n; i++) cin >> l[i];     for (int i = 0; i < n; i++) cin >> r[i];     for (int i = 0; i < n; i++) a[i] = n - l[i] - r[i];     for (int i = 0; i < n; i++) {       for (int j = 0; j < i; j++) {         l[i] -= (a[j] > a[i]);       }     }     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         r[i] -= (a[j] > a[i]);       }     }     for (int i = 0; i < n; i++) {       if (l[i] != 0 || r[i] != 0) {         cout <<  NO n ;         return 0;       }     }     cout <<  YES n ;     for (int i = 0; i < n; i++) cout << a[i] <<    ;     cout <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       long long int a, b, c, r, x, y, z, i, j, k, count = 0, result;       cin >> a >> b >> c >> r;       x = c - r;       y = c + r;       r = (a >= b) ? a : b;       z = (a <= b) ? a : b;       a = z;       b = r;       if (x < a && y <= b && y >= a)         count = y - a;       else if (x >= a && y <= b)         count = y - x;       else if (x < b && x >= a && y > b)         count = b - x;       else if (x < a && y > b)         count = b - a;       else         count = 0;       result = b - a - count;       cout << result <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1e9 + 7;   using namespace std;   const string tp[4] = { aaaa ,  aabb ,  abab ,  abba };   int n, k;   int m;   string w[10000];   int prime(int x) {     if (x == 1) return 0;     for (int i = 2; i * i <= x; i++)       if (x % i == 0) return 0;     return 1;   }   int check(int x, int y) {     if (x > n || x < 1 || y >= m || y < 0) return 0;     return 1;   }   long long gcd(long long a, long long b) {     if (b == 0) {       return a;     }     return gcd(b, a % b);   }   int vowel(char t) {     if (t ==  a  || t ==  e  || t ==  i  || t ==  o  || t ==  u ) return 1;     return 0;   }   int main() {     cin >> n >> k;     int bad = 0;     for (int i = 0; i < n * 4; i++) {       string s;       cin >> s;       w[i] =   ;       int l = 0;       while (l < k and s.size()) {         char c = s[s.size() - 1];         w[i] += c;         s.erase(s.size() - 1);         l += vowel(c);       }       if (l < k) {         bad = 1;       }     }     if (!bad) {       for (int t = 0; t < 4; t++) {         int ok2 = 1;         for (int i = 0; i < n * 4; i += 4) {           int ok = 1;           for (int p = 0; p < 4 and ok; p++) {             for (int q = p + 1; q < 4 and ok; q++) {               if (tp[t][p] == tp[t][q] and w[i + p] != w[i + q]) {                 ok = 0;               }             }           }           if (!ok) {             ok2 = 0;             break;           }         }         if (ok2) {           cout << tp[t];           return 0;         }       }     }     cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e6 + 5;   int n, k, l, sm[MAXN];   char s[MAXN];   pair<long long, long long> dp[MAXN];   long long solve(char a) {     for (int i = 1; i <= n; i++) sm[i] = sm[i - 1] + (s[i] == a);     int lo = 0, hi = l;     long long ans = 0;     while (lo <= hi) {       int mi = (lo + hi) / 2;       for (int i = 1; i <= l; i++) dp[i] = max(dp[i - 1], {sm[i] - mi, -1});       for (int i = l + 1; i <= n; i++)         dp[i] = max(dp[i - 1], {dp[i - l].first + sm[i] - sm[i - l] - mi,                                 dp[i - l].second - 1});       if (-dp[n].second <= k)         hi = mi - 1, ans = dp[n].first;       else         lo = mi + 1;     }     return sm[n] - k * lo - ans;   }   int main() {     scanf( %d %d %d , &n, &k, &l);     scanf( %s , s + 1);     if ((long long)k * (long long)l >= n) return !printf( 0 n );     for (int i = 1; i <= n; i++) s[i] =  a  <= s[i] ?  a  :  b ;     printf( %I64d n , min(solve( a ), solve( b )));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 9;   int main() {     long long n, m;     cin >> n >> m;     vector<int> row(n), col(n);     int r = 0, c = 0;     int x, y;     long long ans = n * n;     for (int i = 0; i < m; i++) {       scanf( %d %d , &x, &y);       long long v = 0;       if (row[x - 1] == 0 && col[y - 1] == 0)         v = n + n - (1 + r + c);       else if (row[x - 1] && col[y - 1])         v = 0;       else if (row[x - 1])         v = n - r;       else if (col[y - 1])         v = n - c;       ans -= v;       if (row[x - 1] == 0) row[x - 1] = 1, r++;       if (col[y - 1] == 0) col[y - 1] = 1, c++;       printf( %lld  , ans);     }     printf(  n );   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     long long tecpoint = 0;     vector<long long> mas(n);     for (int i = 0; i < n; i++) {       long long a;       cin >> mas[i];     }     vector<long long> questions(m);     vector<bool> visited(n);     for (int i = 0; i < m; i++) {       int a;       cin >> a;       a--;       questions[i] = mas[a];       visited[a] = 1;     }     for (int i = 0; i < n; i++) {       if (!visited[i]) tecpoint += mas[i];     }     vector<bool> take(m);     for (int i = 0; i < m; i++) {       long long tecma = 0;       long long tecmai = 0;       for (int j = 0; j < m; j++) {         if (take[j]) continue;         if (max(questions[j], tecpoint) > tecma) {           tecma = max(questions[j], tecpoint);           tecmai = j;         }       }       tecpoint += tecma;       take[tecmai] = 1;     }     cout << tecpoint <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main(int argc, char *argv[]) {     int n, m, i;     scanf( %d , &n);     m = 1;     for (i = 1; i < n; i++) {       m = (m + i);       if (m > n) m -= n;       printf( %d , m);       if (i < n)         printf(   );       else         printf(  n );     }     return EXIT_SUCCESS;   }
#include <bits/stdc++.h>   using namespace std;   long long x, y, c;   int n;   const int maxn = 300009;   char str[maxn];   long long cnt = 0;   int main() {     cin >> n >> x >> y;     cin >> str;     int now = 0;     for (int i = 0; i < n; ++i) {       if (str[i] ==  1 ) {         if (now != 0) cnt++;         now = 0;       } else {         now++;       }     }     if (now) cnt++;     if (!cnt) return 0 * puts( 0 );     if (y <= x)       cout << cnt * y << endl;     else {       cout << (cnt - 1) * x + y << endl;     }     return 0;   }
#include <bits/stdc++.h>   int main() {     int n, bags[100000], i;     scanf( %d , &n);     for (i = 0; i < (n * n); i++) bags[i] = (i + 1);     for (i = 0; i < ((n * n) / 2); i += 2) {       printf( %d  , bags[i]);       printf( %d  , bags[(n * n) - i - 1]);     }     printf(  n );     for (i = 1; i <= (((n * n) / 2)); i += 2) {       printf( %d  , bags[i]);       printf( %d  , bags[(n * n) - i - 1]);     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e5 + 10;   int n;   vector<int> g[MAXN];   int d[MAXN];   int bio[MAXN];   void dfs(int x, int dep) {     d[x] = dep;     bio[x] = 1;     for (int i : g[x])       if (!bio[i]) dfs(i, dep + 1);   }   int main() {     scanf( %d , &n);     int a, b;     for (int i = 0; i < n - 1; i++) {       scanf( %d%d , &a, &b);       a--;       b--;       g[a].push_back(b);       g[b].push_back(a);     }     dfs(0, 1);     double rj = 0;     for (int i = 0; i < n; i++) {       rj += 1.0 / d[i];     }     printf( %lf n , rj);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 200009;   const int MOD = 1e9 + 7;   int main() {     ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0);     int n, k, tot;     cin >> n >> k;     tot = n;     vector<int> sta, vis(n + 2);     vis[n + 1] = 1;     int cur = 1;     vector<int> ans;     for (int i = 0; i < k; ++i) {       int t;       cin >> t;       ans.push_back(t);       sta.push_back(t);       vis[t] = 1;       tot--;       while (((int)(sta).size()) && sta.back() == cur) {         cur++;         sta.pop_back();       }     }     for (int i = 1; i < ((int)(sta).size()); ++i) {       if (sta[i] > sta[i - 1]) {         cout <<  -1 n ;         return 0;       }     }     while (tot) {       while (((int)(sta).size()) && sta.back() == cur) {         cur++;         sta.pop_back();       }       int top;       if (((int)(sta).size()) == 0)         top = n + 1;       else         top = sta.back();       for (int i = top; i >= cur; --i) {         if (!vis[i]) sta.push_back(i), tot--, ans.push_back(i);         vis[i] = 1;       }     }     for (int i : ans) cout << i <<    ;     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long arr[200005], lazy[4 * 200005], seg[4 * 200005];   void build(int node, int start, int end) {     int mid = (start + end) / 2;     if (start == end) {       lazy[node] = 0;       seg[node] = arr[start];       return;     }     build(2 * node, start, mid);     build(2 * node + 1, mid + 1, end);     seg[node] = min(seg[2 * node], seg[2 * node + 1]);   }   void update(int node, int start, int end, int left, int right, long long val) {     int mid = (start + end) / 2;     if ((start > right) || (end < left)) return;     if ((left <= start) && (end <= right)) {       lazy[node] += val;       seg[node] += val;       return;     } else {       update(2 * node, start, mid, left, right, val);       update(2 * node + 1, mid + 1, end, left, right, val);       seg[node] = min(seg[2 * node], seg[2 * node + 1]) + lazy[node];     }   }   long long query(int node, int start, int end, int left, int right) {     int mid = (start + end) / 2;     if ((start > right) || (end < left)) return LLONG_MAX;     if ((left <= start) && (end <= right))       return seg[node];     else       return lazy[node] + min(query(2 * node, start, mid, left, right),                               query(2 * node + 1, mid + 1, end, left, right));   }   int main() {     int n, m, lf, rg;     long long v;     char c;     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %lld , &arr[i]);     build(1, 0, n - 1);     scanf( %d , &m);     for (int i = 0; i < m; i++) {       scanf( %d%d , &lf, &rg);       c = getchar();       if (c !=   n ) {         scanf( %lld , &v);         if (lf <= rg)           update(1, 0, n - 1, lf, rg, v);         else {           update(1, 0, n - 1, lf, n - 1, v);           update(1, 0, n - 1, 0, rg, v);         }       } else {         if (lf <= rg)           printf( %lld n , query(1, 0, n - 1, lf, rg));         else           printf( %lld n ,                  min(query(1, 0, n - 1, lf, n - 1), query(1, 0, n - 1, 0, rg)));       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int sa[100005], s1[100005];   char s[100005];   int save[6];   int main() {     int n;     while (scanf( %d , &n) != EOF) {       for (int a = 1; a <= n; a++) scanf( %d , &sa[a]);       scanf( %s , s + 1);       int l = -1000000000, r = 1000000000;       for (int a = 1; a <= n; a++) s1[a] = s[a] - 48;       for (int a = 5; a <= n; a++) {         for (int b = a - 4; b <= a; b++) save[b - (a - 5)] = sa[b];         sort(save + 1, save + 1 + 5);         if (s1[a - 1] == 0 && s1[a - 2] == 0 && s1[a - 3] == 0 &&             s1[a - 4] == 0) {           if (s1[a] == 1 && s1[a - 1] != 1)             l = max(l, save[5] + 1);           else {             continue;           }         } else if (s1[a - 1] == 1 && s1[a - 2] == 1 && s1[a - 3] == 1 &&                    s1[a - 4] == 1) {           if (s1[a] == 0 && s1[a - 1] != 0) {             r = min(r, save[1] - 1);           } else             continue;         } else {           continue;         }       }       printf( %d %d n , l, r);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int a, b, c, x, y, z;     cin >> a >> b >> c >> x >> y >> z;     int cnt = 0;     if (a > x) cnt += (a - x) / 2;     if (b > y) cnt += (b - y) / 2;     if (c > z) cnt += (c - z) / 2;     if (a < x)       if (x - a <= cnt) {         cnt -= x - a;         a += x - a;       }     if (b < y)       if (y - b <= cnt) {         cnt -= y - b;         b += y - b;       }     if (c < z)       if (z - c <= cnt) {         cnt -= z - c;         c += z - c;       }     if (a >= x && b >= y && c >= z)       cout <<  Yes  << endl;     else       cout <<  No  << endl;     return 0;   }