malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   #pragma GCC optimize(2)   using namespace std;   inline int read() {     int x = 0, w = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) w = -1;       c = getchar();     }     while (c <=  9  && c >=  0 ) {       x = (x << 1) + (x << 3) + c -  0 ;       c = getchar();     }     return w == 1 ? x : -x;   }   int n, cnt, tot, l[800005], r[800005], a[800005 << 1], lx[800005], rx[800005],       p[800005], t[800005], p2[800005], h[800005];   int main() {     int T = read();     while (T--) {       n = read();       cnt = 0;       tot = 0;       for (int i = 1; i <= n; i++) {         l[i] = read(), r[i] = read();         a[++cnt] = l[i], a[++cnt] = r[i];       }       sort(a + 1, a + cnt + 1);       tot = unique(a + 1, a + cnt + 1) - a - 1;       for (int i = 1; i <= n; i++) {         lx[i] = lower_bound(a + 1, a + tot + 1, l[i]) - a;         rx[i] = lower_bound(a + 1, a + tot + 1, r[i]) - a;         lx[i] <<= 1;         rx[i] <<= 1;       }       int tmp = 0;       for (int i = 1; i <= tot * 2; i++) p2[i] = 0, h[i] = 0, p[i] = 0;       for (int i = 1; i <= tot * 2; i++) t[i] = 0;       for (int i = 1; i <= n; i++) t[lx[i]]++, t[rx[i] + 1]--;       for (int i = 1; i <= tot * 2; i++) tmp += t[i], p[i] = tmp;       for (int i = 1; i <= tot * 2; i++)         if (p[i] != p[i - 1] && p[i] == 1) p2[i] = 1;       for (int i = 1; i <= tot * 2; i++) h[i] = h[i - 1] + p2[i];       int ans = -1e9, ans1 = 0;       for (int i = 1; i <= tot * 2 + 1; i++)         if (p[i] != 0 && p[i - 1] == 0) ans1++;       for (int i = 1; i <= n; i++) {         int q = h[rx[i]] - h[lx[i] - 1];         q -= (p[rx[i]] == 1), q -= (p[lx[i]] == 1);         ans = max(ans, q);       }       cout << ans1 + ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[105];   int b[105];   bool cmp(int a, int b) { return a > b; }   int main() {     int n, x = 0, y = 0, m;     int cnt = 0;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &m);       for (int j = 1; j <= m; j++) {         scanf( %d , &a[j]);       }       if (m & 1) {         for (int j = 1; j <= m / 2; j++) {           x += a[j];         }         b[cnt++] = a[m / 2 + 1];         for (int j = m / 2 + 2; j <= m; j++) {           y += a[j];         }       } else {         for (int j = 1; j <= m / 2; j++) {           x += a[j];         }         for (int j = m / 2 + 1; j <= m; j++) {           y += a[j];         }       }     }     sort(b, b + cnt, cmp);     for (int i = 0; i < cnt; i++) {       if (i & 1)         y += b[i];       else         x += b[i];     }     printf( %d %d , x, y);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 3e5 + 10;   int n, x1, x2;   pair<int, int> c[N], f[2];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> x1 >> x2;     for (int i = 0; i < n; i++) cin >> c[i].first, c[i].second = i;     sort(c, c + n);     int i = n - 1;     for (; ~i; --i)       if (i + (x1 + c[i].first - 1) / c[i].first - 1 < n) {         f[0] = {i, i + (x1 + c[i].first - 1) / c[i].first};         break;       }     int j = i;     for (; ~i; --i)       if (i + (x2 + c[i].first - 1) / c[i].first - 1 < j) {         f[1] = {i, i + (x2 + c[i].first - 1) / c[i].first};         break;       }     if (i >= 0) {       cout <<  Yes n ;       cout << f[0].second - f[0].first <<     << f[1].second - f[1].first <<   n ;       for (; f[0].first < f[0].second; f[0].first++)         cout << c[f[0].first].second + 1 <<    ;       cout <<   n ;       for (; f[1].first < f[1].second; f[1].first++)         cout << c[f[1].first].second + 1 <<    ;       return 0;     }     i = n - 1;     for (; ~i; --i)       if (i + (x2 + c[i].first - 1) / c[i].first - 1 < n) {         f[1] = {i, i + (x2 + c[i].first - 1) / c[i].first};         break;       }     j = i;     for (; ~i; --i)       if (i + (x1 + c[i].first - 1) / c[i].first - 1 < j) {         f[0] = {i, i + (x1 + c[i].first - 1) / c[i].first};         break;       }     if (i >= 0) {       cout <<  Yes n ;       cout << f[0].second - f[0].first <<     << f[1].second - f[1].first <<   n ;       for (; f[0].first < f[0].second; f[0].first++)         cout << c[f[0].first].second + 1 <<    ;       cout <<   n ;       for (; f[1].first < f[1].second; f[1].first++)         cout << c[f[1].first].second + 1 <<    ;       return 0;     }     cout <<  No ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<string, int> H;   string s;   int l, rs;   void Read_Input() {     cin >> s;     l = s.length();     rs = 0;     int i, j, k;     for (i = 0; i < l; i++)       for (j = i + 1; j < l; j++) {         for (k = 0; j + k < l && s[i + k] == s[j + k]; k++)           ;         if (rs < k) rs = k;       }     cout << rs << endl;   }   int main() {     Read_Input();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int q, n, sum;     cin >> q;     while (q--) {       cin >> n;       int m = n;       sum = 0;       while (n--) {         int x;         cin >> x;         sum += x;       }       double y = (double)sum / m;       int rs = y;       if (y == rs) {         cout << rs << endl;       } else {         cout << rs + 1 << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 205;   int n, k;   int main() {     scanf( %d , &k);     if (k == 1) {       printf( YES n2 1 n1 2 n );       return 0;     }     if (k % 2 == 0) {       printf( NO n );       return 0;     }     printf( YES n );     printf( %d %d n , 2 * (k + 2), k * (k + 2));     n = k + 2;     for (int i = 2; i < n - 1; i++) printf( 1 %d n , i);     for (int i = 2; i <= n; i++)       for (int j = i + 1; j <= n; j++) {         if (i % 2 == 0 && j == i + 1) continue;         printf( %d %d n , i, j);       }     printf( %d %d n , n - 1, n);     for (int i = 2; i < n - 1; i++) printf( %d %d n , n + 1, i + n);     for (int i = 2; i <= n; i++)       for (int j = i + 1; j <= n; j++) {         if (i % 2 == 0 && j == i + 1) continue;         printf( %d %d n , n + i, n + j);       }     printf( %d %d n , n + n - 1, n + n);     printf( %d %d n , 1, n + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long Min(long long a, long long b) { return a < b ? a : b; }   bool cmp(long long a, long long b) { return a > b; }   long long a[3];   int main() {     while (~scanf( %lld%lld%lld , &a[0], &a[1], &a[2])) {       long long ans = 0;       sort(a, a + 3, cmp);       a[0] -= a[2], a[1] -= a[2], a[2] = 0;       if (a[0] == 0 && a[1] == 0)         ans = 0;       else if (a[1] == 0)         ans += (a[0] - 1) * 2;       else if (a[0] == a[1])         ans += a[1] - 1;       else {         ans += a[1];         a[0] -= a[1], a[1] = 0;         ans += (a[0] - 1) * 2;       }       printf( %lld n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   const int LG = 20;   int n, a[N], u, v;   long long dp[LG][N][2];   long long sdp[LG][N][2];   long long ans, ans2;   vector<int> G[N];   bool mark[N];   int h[N];   void input();   void find_ans();   void dfs(int, int);   int main() {     input();     for (int i = 0; i < LG; i++) {       dfs(0, i);       fill(mark, mark + n, false);     }     find_ans();     cout << ans + (ans2 / 2) << endl;   }   void input() {     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n - 1; i++) {       cin >> u >> v;       u--, v--;       G[u].push_back(v);       G[v].push_back(u);     }   }   void dfs(int x, int z) {     mark[x] = true;     for (int i = 0; i < G[x].size(); i++) {       int y = G[x][i];       if (!mark[y]) {         h[y] = h[x] + 1;         dfs(y, z);         dp[z][x][0] += dp[z][y][(a[x] >> z) & 1];         dp[z][x][1] += dp[z][y][1 - ((a[x] >> z) & 1)];         sdp[z][x][0] += dp[z][y][0];         sdp[z][x][1] += dp[z][y][1];       }     }     dp[z][x][(a[x] >> z) & 1]++;   }   void find_ans() {     for (int i = 0; i < LG; i++)       for (int j = 0; j < n; j++) ans += (dp[i][j][1] * (1 << i));     for (int i = 0; i < LG; i++)       for (int j = 0; j < n; j++)         for (int k = 0; k < G[j].size(); k++) {           int x = G[j][k];           if (h[x] > h[j]) {             ans2 += (dp[i][x][1]) *                     (sdp[i][j][(a[j] >> i) & 1] - dp[i][x][(a[j] >> i) & 1]) *                     (1 << i);             ans2 += (dp[i][x][0]) *                     (sdp[i][j][1 - ((a[j] >> i) & 1)] -                      dp[i][x][1 - ((a[j] >> i) & 1)]) *                     (1 << i);           }         }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t;     cin >> t;     while (t--) {       long long n, p, k, i;       cin >> n >> p >> k;       long long a[n];       for (i = 0; i < n; i++) cin >> a[i];       long long dp[n + 1];       dp[0] = 0;       sort(a, a + n);       for (i = 1; i <= n; i++) {         if (i >= k) {           dp[i] = min(dp[i - 1] + a[i - 1], dp[i - k] + a[i - 1]);         } else {           dp[i] = dp[i - 1] + a[i - 1];         }       }       long long ans = 0;       for (i = 1; i <= n; i++) {         if (dp[i] <= p) ans = i;       }       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   const int maxn = 1e6 + 9, mod = 998244353, inf = 0x3f3f3f3f;   int Read() {     int x(0), f(1);     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) f = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) {       x = (x << 3ll) + (x << 1ll) + c -  0 ;       c = getchar();     }     return x * f;   }   void Chkmin(int &x, int y) {     if (y < x) x = y;   }   void Chkmax(int &x, int y) {     if (y > x) x = y;   }   int add(int x, int y) { return x += y, x >= mod ? x - mod : x; }   int dec(int x, int y) { return x -= y, x < 0 ? x + mod : x; }   int mul(int x, int y) { return 1ll * x * y % mod; }   int Pow(int base, int b) {     int ret(1);     while (b) {       if (b & 1) ret = mul(ret, base);       base = mul(base, base);       b >>= 1;     }     return ret;   }   int Gcd(int a, int b) { return b ? Gcd(b, a % b) : a; }   struct point {     int x, y;   } a[maxn];   int n, K;   double d[maxn];   std::multiset<double> Set;   std::map<std::pair<int, int>, std::vector<int> > mp;   std::map<std::pair<int, int>, std::vector<int> >::iterator it1;   double Dist(double x, double y) { return std::sqrt(x * x + y * y); }   bool cmp(int x, int y) { return d[x] > d[y]; }   int main() {     n = Read();     K = Read();     for (int i = 1; i <= n; ++i) {       int x(Read()), y(Read());       if (!x && !y) continue;       a[i] = (point){x, y};       d[i] = Dist(x, y);       int z(Gcd(std::abs(x), std::abs(y)));       int xx(x / z), yy(y / z);       mp[std::pair<int, int>(xx, yy)];       it1 = mp.find(std::pair<int, int>(xx, yy));       assert(it1 != mp.end());       it1->second.push_back(i);     }     for (it1 = mp.begin(); it1 != mp.end(); ++it1) {       std::vector<int> A(it1->second);       std::sort(A.begin(), A.end(), cmp);       int m(A.size());       int ret(0);       double pre(0);       int j(1);       for (int i = 1; i <= m; ++i)         if (K - 2 * i + 1 >= 0) {           int x(A[i - 1]);           Set.insert(d[x] * (1.0 * (K - 2 * i + 1)));           j = i + 1;         } else {           int x(A[m - 1 - (i - j)]);           double tmp(-2.0 * pre);           tmp += d[x] * (1.0 * (K - 2 * j + 1));           Set.insert(tmp);           pre += d[x];         }     }     int flag(0);     double ret(0);     while (K--) {       if (!Set.size()) {         continue;       }       if (*Set.rbegin() <= 0 && !flag) {         flag = 1;         continue;       }       ret += *Set.rbegin();       Set.erase(Set.find(*Set.rbegin()));     }     printf( %.10lf n , ret);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[] = {0, 0, 1, -1};   int dy[] = {1, -1, 0, 0};   int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};   int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};   long long bigmod(long long a, long long b, long long c) {     if (b == 0) return 1 % c;     long long x = bigmod(a, b / 2, c);     x = x * x % c;     if (b % 2 == 1) x = x * a % c;     return x;   }   long long mod_inverse(long long a, long long mod) {     return bigmod(a, mod - 2, mod);   }   const int M = 100005 * 2;   int dp[M], dpp[M], sum[27][M * 4], n, m;   string s, p;   void update(int id, int l, int r, int k, int L, int val) {     if (l == r) {       sum[id][k] = val;       return;     }     int mid = (l + r) / 2;     if (mid >= L) {       update(id, l, mid, k * 2, L, val);     } else {       update(id, mid + 1, r, k * 2 + 1, L, val);     }     sum[id][k] = min(sum[id][k * 2], sum[id][k * 2 + 1]);   }   int query(int id, int l, int r, int k, int L, int R) {     if (l > R || r < L) return 2134567891;     if (l >= L && r <= R) return sum[id][k];     int mid = (l + r) / 2;     return min(query(id, l, mid, k * 2, L, R),                query(id, mid + 1, r, k * 2 + 1, L, R));   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> s >> p;     n = s.size();     m = p.size();     s =  #  + s;     p =  #  + p;     int cnt = 0, ptr = 1;     for (int i = 1; i <= n; i++) {       if (ptr <= m && s[i] == p[ptr]) {         cnt++;         ptr++;       }       dp[i] = cnt;     }     cnt = 0, ptr = m;     for (int i = n; i >= 1; i--) {       if (ptr >= 1 && s[i] == p[ptr]) {         ptr--;         cnt++;       }       dpp[i] = cnt;     }     for (int i = 0; i < 26; i++) {       for (int j = 0; j < 4 * M; j++) sum[i][j] = 2134567891;     }     int N = max(n, m);     for (int i = 1; i <= m; i++) {       int lcnt = i - 1;       int rcnt = m - i;       int id = p[i] -  a ;       update(id, 1, N, 1, lcnt + 1, rcnt);     }     for (int i = 1; i <= n; i++) {       int id = s[i] -  a ;       int ret = query(id, 1, N, 1, 1, dp[i - 1] + 1);       if (ret <= dpp[i + 1]) continue;       cout <<  No  << endl;       return 0;     }     cout <<  Yes  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long min(long long a, long long b) {     if (a > b) return b;     return a;   }   long long max(long long a, long long b) {     if (a > b) return a;     return b;   }   long long fact[32600];   int main() {     int n, len, l;     cin >> n;     len = (int)(sqrt(n));     l = 0;     for (int i = 1; i <= len; ++i) {       if (n % i == 0) {         fact[l++] = i;         if (i != n / i) fact[l++] = n / i;       }     }     sort(fact, fact + l);     long long mini = 1LL << 63 - 1, maxi = 0LL;     for (int i = 0; i < l; ++i) {       for (int j = i; j < l; ++j) {         for (int k = j; k < l; ++k) {           long long aux = fact[i] * fact[j] * fact[k];           if (aux == n) {             long long another = (fact[i] + 1) * (fact[j] + 2) * (fact[k] + 2) - n;             long long other = (fact[k] + 1) * (fact[j] + 2) * (fact[i] + 2) - n;             mini = min(another, min(other, mini));             maxi = max(another, max(other, maxi));             another = (fact[j] + 1) * (fact[i] + 2) * (fact[k] + 2) - n;             other = (fact[i] + 1) * (fact[j] + 2) * (fact[k] + 2) - n;             another = (fact[k] + 1) * (fact[i] + 2) * (fact[j] + 2) - n;             other = (fact[j] + 1) * (fact[i] + 2) * (fact[k] + 2) - n;             mini = min(another, min(other, mini));             maxi = max(another, max(other, maxi));           }         }       }     }     cout << mini <<     << maxi << endl;     return 0;   }
#include <iostream>   using namespace std;   int t, n, f[100005];   long long k;      void Solve() {       if (n < 63 && (1ll<<(n-1)) < k) { cout <<  -1 n ; return; }       int p = max(1, n - 62);       long long power = (1ll<<(n-p));       for(int i=1; i<p; ++i) f[i] = i;       for(int i=p; i<=n; ++i) {           power >>= 1;           int c = 0;           for(; power < k && k>1; power >>= 1) {               ++c;               k -= power;           }           for(int j=0; j<=c; ++j) f[i+j] = i+c-j;           i += c;       }       for(int i=1; i<=n; ++i) cout << f[i] <<    ;       cout <<   n ;   }      int main()   {       ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);       cin >> t;       while (t--) {           cin >> n >> k;           Solve();       }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int l, n;     cin >> n >> l;     int a;     int sum[100];     for (int i = 0; i < 100; ++i) sum[i] = 0;     memset(sum, 0, 100);     for (int i = 0; i < n; ++i) {       cin >> a;       for (int j = l; j <= 100; ++j) {         sum[j - 1] = sum[j - 1] + (a / j) * j;         if (a < j) break;       }     }     int maxx = sum[l - 1];     for (int i = l; i < 100; ++i)       if (sum[i] > maxx) maxx = sum[i];     cout << maxx;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 10;   vector<int> a[maxn];   string s;   int i, ma = -1, ans = 0, f = 1;   int main() {     cin >> s;     for (i = 0; i < s.size(); i++) {       if (s[i] ==  0 )         a[++ans].push_back(i);       else {         if (ans == 0) {           f = 0;           break;         }         a[ans--].push_back(i);       }       ma = max(ans, ma);     }     if (ma != ans) f = 0;     if (!f) {       cout << -1;       return 0;     } else {       cout << ma <<   n ;       for (i = 1; i <= ma; i++) {         cout << a[i].size() <<    ;         for (int j = 0; j < a[i].size(); j++) {           cout << a[i][j] + 1 <<    ;         }         cout <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T bigmod(T p, T e, T M) {     long long int ret = 1;     for (; e > 0; e >>= 1) {       if (e & 1) ret = (ret * p) % M;       p = (p * p) % M;     }     return (T)ret;   }   template <class T>   inline T gcd(T a, T b) {     if (b == 0) return a;     return gcd(b, a % b);   }   template <class T>   inline T modinverse(T a, T M) {     return bigmod(a, M - 2, M);   }   template <class T>   inline T bpow(T p, T e) {     long long int ret = 1;     for (; e > 0; e >>= 1) {       if (e & 1) ret = (ret * p);       p = (p * p);     }     return (T)ret;   }   int ts, kk = 1;   struct D {     D *l, *r;     int cnt;     D() {       l = r = NULL;       cnt = 0;     }   };   int n, m;   pair<int, pair<int, int> > a[100005];   D *tr[10005];   void updt(D *rt, int s, int e, int p) {     if (rt == NULL) return;     if (p <= s && e <= p) {       rt->cnt++;       return;     }     if (rt->l == NULL) rt->l = new D();     if (rt->r == NULL) rt->r = new D();     if (p <= ((s + e) >> 1))       updt(rt->l, s, ((s + e) >> 1), p);     else       updt(rt->r, ((s + e) >> 1) + 1, e, p);     rt->cnt++;   }   int qry(D *c, int s, int e, int st, int ed) {     if (c == NULL) return 0;     if (st <= s && e <= ed) return c->cnt;     if (ed <= ((s + e) >> 1)) return qry(c->l, s, ((s + e) >> 1), st, ed);     if (((s + e) >> 1) < st) return qry(c->r, ((s + e) >> 1) + 1, e, st, ed);     return qry(c->l, s, ((s + e) >> 1), st, ed) +            qry(c->r, ((s + e) >> 1) + 1, e, st, ed);   }   int main() {     int t, i, j, k;     scanf( %d%d , &n, &m);     for (i = 0; i < m + 1; i++) tr[i] = NULL;     for (i = 0; i < n; i++) {       scanf( %d%d%d , &j, &k, &t);       a[i] = make_pair(-k, pair<int, int>(t, j));     }     sort(a, a + n);     long long int rs = 0;     for (i = 0; i < n; i++) {       int l, r;       l = a[i].second.second + a[i].first;       r = a[i].second.second - a[i].first;       if (l < 1) l = 1;       if (r > 1000000007LL) r = 1000000007LL;       k = a[i].second.first;       for (j = max(1, k - m); j <= min(10005, k + m); j++)         rs += qry(tr[j], 1, 1000000007LL, l, r);       if (tr[k] == NULL) tr[k] = new D();       updt(tr[k], 1, 1000000007LL, a[i].second.second);     }     printf( %lld n , rs);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int t;     cin >> t;     while (t--) {       long long int n;       cin >> n;       long long int a[n];       set<long long int> s;       for (long long int i = 0; i < n; i++) {         cin >> a[i];         s.insert(a[i]);       }       cout << s.size() << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline void read(long long &x) {     x = 0;     long long f = 1;     char ch = getchar();     while (ch != 45 && (ch >  9  || ch <  0 )) ch = getchar();     if (ch == 45) {       f = -1, ch = getchar();     }     while (ch <=  9  && ch >=  0 ) {       x = x * 10 + ch - 48;       ch = getchar();     }     x *= f;   }   const long long N = 1e5 + 10, M = 35;   long long i, j, k, n, s, t, m;   long long pd[N][M];   long long check(long long x, long long y) {     long long now = 1;     for (long long i = 1; i <= y; i++) {       now *= x;       if (now >= n) return 0;     }     return 1;   }   long long solve(long long x, long long y) {     if (pd[x][y] != -1) return pd[x][y];     if (x > 1e5) return pd[x][y] = (n - x - 1) % 2;     if (y > 32) return pd[x][y] = 2;     if ((solve(x, y + 1) == 0 && check(x, y + 1)) ||         (solve(x + 1, y) == 0 && check(x + 1, y)))       return pd[x][y] = 1;     if ((solve(x, y + 1) == 2 && check(x, y + 1)) ||         (solve(x + 1, y) == 2 && check(x + 1, y)))       return pd[x][y] = 2;     return pd[x][y] = 0;   }   signed main() {     memset(pd, -1, sizeof(pd));     long long a, b;     read(a), read(b), read(n);     if (solve(a, b) == 2) printf( Missing n );     if (solve(a, b) == 1) printf( Masha n );     if (solve(a, b) == 0) printf( Stas n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a, b, c, x, y, z, st;   int proc(int l, int r) {     if (l > r) return (l - r) / 2;     return l - r;   }   int main() {     scanf( %d%d%d , &a, &b, &c);     scanf( %d%d%d , &x, &y, &z);     st = 0;     st += proc(a, x);     st += proc(b, y);     st += proc(c, z);     if (st >= 0)       puts( Yes );     else       puts( No );   }
#include <bits/stdc++.h>   using namespace std;   string name[102];   bool istaxi(string s) {     s.erase(5, 1);     s.erase(2, 1);     for (int i = 1; i < 6; i++) {       if (s[i] != s[i - 1]) {         return 0;       }     }     return 1;   }   bool ispizza(string s) {     s.erase(5, 1);     s.erase(2, 1);     for (int i = 1; i < 6; i++) {       if (s[i] >= s[i - 1]) {         return 0;       }     }     return 1;   }   int pizza[102], taxi[102], girl[102];   int maxT, maxG, maxP;   int main() {     int n, t;     cin >> t;     for (int i = 0; i < t; i++) {       cin >> n >> name[i];       for (int j = 0; j < n; j++) {         string phone;         cin >> phone;         if (istaxi(phone)) {           taxi[i]++;           maxT = max(maxT, taxi[i]);         } else if (ispizza(phone)) {           pizza[i]++;           maxP = max(maxP, pizza[i]);         } else {           girl[i]++;           maxG = max(maxG, girl[i]);         }       }     }     string tt, gg, pp;     for (int i = 0; i < t; i++) {       if (maxT == taxi[i]) tt +=     + name[i] +  , ;     }     tt[tt.length() - 1] =  . ;     cout <<  If you want to call a taxi, you should call:  << tt << endl;     for (int i = 0; i < t; i++) {       if (maxP == pizza[i]) pp +=     + name[i] +  , ;     }     pp[pp.length() - 1] =  . ;     cout <<  If you want to order a pizza, you should call:  << pp << endl;     for (int i = 0; i < t; i++) {       if (maxG == girl[i]) gg +=     + name[i] +  , ;     }     gg[gg.length() - 1] =  . ;     cout <<  If you want to go to a cafe with a wonderful girl, you should call:           << gg << endl;   }