malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 100005, M = 1000000007;   int n, i, a, b, n1, n2;   struct str {     int a, b, t;   } s1[300005], s2[300005];   bool cmp1(str a, str b) { return a.a > b.a; }   bool cmp2(str a, str b) { return a.a < b.a; }   int main() {     scanf( %d , &n);     for (i = 1; i <= n; i++) {       scanf( %d %d , &a, &b);       if (a < b)         s1[++n1] = (str){a, b, i};       else         s2[++n2] = (str){a, b, i};     }     if (n1 > n2) {       sort(s1 + 1, s1 + 1 + n1, cmp1);       printf( %d n , n1);       for (i = 1; i <= n1; i++) printf( %d  , s1[i].t);     } else {       sort(s2 + 1, s2 + 1 + n2, cmp2);       printf( %d n , n2);       for (i = 1; i <= n2; i++) printf( %d  , s2[i].t);     }   }
#include <bits/stdc++.h>   using namespace std;   vector<int> v;   void solve(int n) {     int m = 1;     while (n > 0) {       if (n & 1) v.push_back(m);       n >>= 1;       m++;     }     reverse(v.begin(), v.end());   }   int main() {     ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);     int n;     cin >> n;     solve(n);     for (auto it : v) {       cout << it <<    ;     }     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int MAXN = 100;   struct mtx {     int d[MAXN][MAXN];     int r, c;   };   mtx operator*(const mtx l, const mtx r) {     mtx res;     res.r = l.r;     res.c = r.c;     assert(l.c == r.r);     for (int i = 0; i < res.r; i++)       for (int j = 0; j < res.c; j++) {         int sm = 0;         for (int k = 0; k < l.c; k++) {           sm += 1ll * l.d[i][k] * r.d[k][j] % mod;           sm %= mod;         }         res.d[i][j] = sm;       }     return res;   }   void idmtx(mtx &m) {     assert(m.r == m.c);     for (int i = 0; i < m.r; i++) {       for (int j = 0; j < m.c; j++) {         m.d[i][j] = i == j;       }     }   }   mtx mtxpow(const mtx m, long long p) {     mtx r;     r.r = r.c = m.r;     idmtx(r);     mtx c = m;     for (; p; p >>= 1) {       if (p & 1) r = r * c;       c = c * c;     }     return r;   }   void printmtx(const mtx m) {     cout <<  MTX ----   << endl;     for (int i = 0; i < m.r; i++) {       for (int j = 0; j < m.c; j++) {         cout << m.d[i][j] <<    ;       }       cout << endl;     }   }   int main() {     long long n;     int m;     cin >> n >> m;     mtx rm;     rm.r = rm.c = m;     for (int i = 0; i < m; i++) {       for (int j = 0; j < m; j++) {         rm.d[i][j] = 0;         if (i == j) rm.d[i][j] += 1;         if (j == 0) {           rm.d[i][j] += i == m - 1 ? 1 : 0;         } else {           rm.d[i][j] += rm.d[i][j - 1];         }         rm.d[i][j] %= mod;       }     }     long long off = (n - 1) % m, k = (n - 1) / m;     mtx res = mtxpow(rm, k + 1);     cout << res.d[m - 1][off] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long n;     long double s;     cin >> n >> s;     vector<long long> cnt(n);     for (long long i = 0; i < n - 1; ++i) {       long long u, v;       cin >> u >> v;       --u;       --v;       ++cnt[u];       ++cnt[v];     }     long long ans = 0;     for (long long i = 0; i < n; ++i) ans += (cnt[i] == 1);     cout << setprecision(20) << 2.0 * s / ans << endl;     return 0;   }
#include <bits/stdc++.h>   int main() {     char n[10005];     scanf( %[^ n] , n);     int len = strlen(n);     char temp[len + 1];     int j = 0;     for (int i = 0; i < len; i++) {       if (n[i] >=  a  && n[i] <=  z ) {         temp[j] = n[i];         j++;       } else if (n[i] ==    ) {         if (n[i - 1] ==    ) {           continue;         } else if (n[i + 1] ==     && n[i - 1] ==    ) {           continue;         } else {           temp[j] = n[i];           j++;         }       } else if (n[i] ==  ,  || n[i] ==  ?  || n[i] ==  .  || n[i] ==  ! ) {         if (n[i - 1] ==    ) {           j--;           temp[j] = n[i];           j++;         } else {           temp[j] = n[i];           j++;         }         if (n[i + 1] !=    ) {           temp[j] =    ;           j++;         }       }     }     temp[j] =   0 ;     printf( %s n , temp);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void print(vector<int> s) {     for (int i = 0; i < s.size(); i++) cout << s[i] <<    ;     cout << endl;   }   const int INF = 1e9 + 7;   char next(char v) {     if (v ==  R ) return  L ;     if (v ==  L ) return  R ;     if (v ==  U ) return  D ;     if (v ==  D ) return  U ;   }   int now(char v) {     if (v ==  R ) return 1;     if (v ==  L ) return 3;     if (v ==  U ) return 0;     if (v ==  D ) return 2;   }   int main() {     int n;     cin >> n;     string s;     cin >> s;     vector<int> dp(n, INF);     dp[0] = 1;     vector<int> last(4, -1);     last[now(s[0])] = 0;     for (int i = 1; i < n; i++) {       int a = last[now(next(s[i]))];       int b = last[(now(s[i]) + 1) % 4];       int c = last[(now(s[i]) + 3) % 4];       int d = min(b, c);       last[now(s[i])] = i;       if (a == -1 && d == -1) {         dp[i] = 1;         continue;       }       if (a == -1) {         dp[i] = min(dp[i], dp[d] + 1);         continue;       }       if (d == -1) {         dp[i] = min(dp[i], dp[a] + 1);         continue;       }       dp[i] = min(dp[i], dp[max(a, d)] + 1);     }     cout << dp[n - 1] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a, b, n;   const int MOD = 1e9 + 7;   long long fac[1111111];   bool ok(int x) {     while (x) {       if (x % 10 == a || x % 10 == b) {         x /= 10;       } else         return 0;     }     return 1;   }   void init() {     fac[0] = fac[1] = 1;     for (int i = 2; i <= 1000000; i++) {       fac[i] = (fac[i - 1] * i) % MOD;     }   }   void gcd(long long a, long long b, long long& d, long long& x, long long& y) {     if (!b) {       d = a;       x = 1;       y = 0;     } else {       gcd(b, a % b, d, y, x);       y -= x * (a / b);     }   }   long long inv(long long a, long long n) {     long long d, x, y;     gcd(a, n, d, x, y);     return d == 1 ? (x + n) % n : -1;   }   long long C(int n, int m) {     return fac[n] * inv(fac[m] * fac[n - m] % MOD, MOD) % MOD;   }   int main() {     init();     long long ans;     int len;     while (scanf( %d%d%d , &a, &b, &n) != EOF) {       ans = 0;       for (len = 0; len <= n; len++) {         if (ok(a * len + b * (n - len))) ans = (ans + C(n, len)) % MOD;       }       printf( %I64d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 3e5 + 10;   bool vis[10005][10005], rev[10005];   struct E {     int nxt, to;   } e[MAXN];   int tot, head[MAXN];   inline void add(int x, int y) {     e[++tot] = (E){head[x], y};     head[x] = tot;   }   int opt[MAXN], X[MAXN], Y[MAXN], s[MAXN], m, n, q;   long long ans[MAXN];   void dfs(int x, int sum) {     int tmp = 0, i = x;     if (opt[i] == 1) {       if (vis[X[i]][Y[i]] == rev[X[i]])         tmp = 1, ++sum, ++s[X[i]], vis[X[i]][Y[i]] = !rev[X[i]];     }     if (opt[i] == 2) {       if (vis[X[i]][Y[i]] != rev[X[i]])         tmp = 1, --sum, --s[X[i]], vis[X[i]][Y[i]] = rev[X[i]];     }     if (opt[i] == 3) {       sum += m - s[X[i]] - s[X[i]];       rev[X[i]] ^= 1;       s[X[i]] = m - s[X[i]];     }     ans[i] = sum;     for (int i = head[x]; i; i = e[i].nxt) dfs(e[i].to, sum);     if (opt[x] == 1 && tmp) --sum, --s[X[i]], vis[X[i]][Y[i]] = rev[X[i]];     if (opt[x] == 2 && tmp) ++sum, ++s[X[i]], vis[X[i]][Y[i]] = !rev[X[i]];     if (opt[x] == 3)       sum -= m - s[X[i]] - s[X[i]], rev[X[i]] ^= 1, s[X[i]] = m - s[X[i]];   }   int main() {     scanf( %d%d%d , &n, &m, &q);     for (int i = 1; i <= q; ++i) {       scanf( %d%d , &opt[i], &X[i]);       if (opt[i] < 3) scanf( %d , &Y[i]);       if (opt[i] == 4)         add(X[i], i);       else         add(i - 1, i);     }     dfs(0, 0);     for (int i = 1; i <= q; ++i) printf( %lld n , ans[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       vector<int> v(n);       for (int i = 0; i < n; i++) cin >> v[i];       int u = 1e9;       for (int a = 0; a <= 2; a++) {         for (int b = 0; b <= 2; b++) {           bool g = true;           int r = 0;           for (int i = 0; i < n; i++) {             bool f = false;             int m = 1e9;             for (int x = 0; x <= a; x++) {               for (int y = 0; y <= b; y++) {                 int s = v[i] - x - 2 * y;                 if (s >= 0 && s % 3 == 0) {                   f = true;                   m = min(m, s / 3);                 }               }             }             if (f)               r = max(r, a + b + m);             else               g = false;           }           if (g) u = min(u, r);         }       }       cout << u <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   const int INF = 1e9 + 5;   const long long INF64 = 1e18;   template <typename T>   string to_string(const vector<T>& v) {     string ret =  < ;     for (auto it : v) {       ret += to_string(it) +  ,  ;     }     ret.pop_back();     ret.pop_back();     ret +=  > ;     return ret;   }   void debug_print() { cerr << endl; }   template <typename T, typename... U>   void debug_print(T t, U... u) {     cerr <<     << to_string(t);     debug_print(u...);   }   const int N = 1e5 + 5;   void normalize(string& s, int m) {     reverse(s.begin(), s.end());     while (s.size() < m) s.push_back( 0 );     reverse(s.begin(), s.end());   }   string a, b;   int solve() {     if (a.size() == 1) {       return a[0] == b[0] ? 0 : a[0] > b[0] ? 1 : -1;     }     for (int i = 0; i < a.size() - 2; i++) {       if (a[i] == b[i]) continue;       int mx = min(a[i], b[i]);       a[i] -= mx;       b[i] -= mx;       if (a[i] >= 2) return 1;       if (b[i] >= 2) return -1;       if (a[i] > 0) {         a[i + 1]++;         a[i + 2]++;       }       if (b[i] > 0) {         b[i + 1]++;         b[i + 2]++;       }     }     if (a[a.size() - 2] != b[a.size() - 2]) {       return a[a.size() - 2] == b[a.size() - 2]  ? 0              : a[a.size() - 2] > b[a.size() - 2] ? 1                                                  : -1;     }     if (a.back() != b.back()) {       return a.back() == b.back() ? 0 : a.back() > b.back() ? 1 : -1;     }     return 0;   }   int main() {     cin >> a >> b;     if (a.size() > b.size())       normalize(b, a.size());     else       normalize(a, b.size());     int ans = solve();     if (ans == 0)       cout <<  =  << endl;     else if (ans == 1)       cout <<  >  << endl;     else       cout <<  <  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     scanf( %d , &n);     vector<pair<int, int> > v(n);     multiset<int> l, r;     for (int i = 0; i < n; i++) {       scanf( %d%d , &v[i].first, &v[i].second);       l.insert(v[i].first);       r.insert(v[i].second);     }     int ans = 0;     for (int i = 0; i < n; i++) {       l.erase(l.find(v[i].first));       r.erase(r.find(v[i].second));       ans = max(ans, *r.begin() - *--l.end());       l.insert(v[i].first);       r.insert(v[i].second);     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int r[305];   int main() {     int p, n;     cin >> p >> n;     int a[n + 5];     for (int i = 1; i <= n; i++) {       cin >> a[i];     }     int sum = 0, c = 0, f = -1;     for (int i = 1; i <= n; i++) {       c = a[i] % p;       if (r[c] == 0) {         f = -1;         r[c]++;       } else {         f = i;         break;       }     }     cout << f << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = (int)1e6 + 123;   const long long INF = (long long)1e18 + 123;   const int inf = (int)1e9 + 123;   const int MOD = (int)1e9 + 7;   void megaRandom() {     unsigned int FOR;     asm( rdtsc  :  =A (FOR));     srand(FOR);   }   int n;   vector<int> g[N];   long double res;   void dfs(int x, int pr = 0, int h = 1) {     if (h > 0) res += (1.0 / h);     for (auto to : g[x]) {       if (to == pr) continue;       dfs(to, x, h + 1);     }   }   int main() {     megaRandom();     cin >> n;     for (int i = 1, x, y; i < n; i++) {       cin >> x >> y;       g[x].push_back(y), g[y].push_back(x);     }     dfs(1);     cout << fixed << setprecision(6) << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 998244353;   const int N = 2010;   int f[N][N], g[N], dp[N];   int p[N], ip[N];   int power(int x, int y) {     int ret = 1;     for (; y; y >>= 1, x = 1ll * x * x % mod) {       if (y & 1) ret = 1ll * ret * x % mod;     }     return ret;   }   int main() {     int i, j;     int x, y, n;     scanf( %d , &n);     scanf( %d%d , &x, &y);     x = 1ll * x * power(y, mod - 2) % mod;     p[0] = 1;     for (i = 1; i <= n; i++) p[i] = 1ll * p[i - 1] * x % mod;     ip[0] = 1;     for (i = 1; i <= n; i++) ip[i] = 1ll * ip[i - 1] * (1 - x + mod) % mod;     f[0][0] = 1;     for (i = 1; i <= n; i++)       for (j = 0; j <= i; j++)         f[i][j] = (1ll * f[i - 1][j] * p[j] +                    (j == 0 ? 0 : 1ll * f[i - 1][j - 1] * ip[i - j])) %                   mod;     g[1] = 1;     for (i = 2; i <= n; i++) {       g[i] = 1;       for (j = 1; j <= i - 1; j++) g[i] = (g[i] - 1ll * g[j] * f[i][j]) % mod;       g[i] = (g[i] + mod) % mod;     }     dp[1] = 0;     for (i = 2; i <= n; i++) {       dp[i] = i * (i - 1) / 2;       dp[i] = 1ll * dp[i] * g[i] % mod;       for (j = 1; j <= i - 1; j++)         dp[i] = (dp[i] + 1ll * g[j] * f[i][j] % mod *                              (dp[j] + j * (j - 1) / 2 + dp[i - j])) %                 mod;       dp[i] = 1ll * dp[i] * power(1 - g[i] + mod, mod - 2) % mod;     }     dp[n] = (dp[n] + mod) % mod;     dp[n] = (dp[n] + n * (n - 1) / 2) % mod;     printf( %d n , dp[n]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 200000;   const int MOD = int(1E9) + 7;   int pow_mod(int b, int p) {     int ret = 1;     while (p) {       if (p & 1) ret = 1LL * ret * b % MOD;       b = 1LL * b * b % MOD;       p >>= 1;     }     return ret;   }   int P[MAXN + 5], S[MAXN + 5];   int l[MAXN + 5], r[MAXN + 5], n;   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , &l[i]);     for (int i = 1; i <= n; i++) scanf( %d , &r[i]);     for (int i = 1; i < n; i++) {       int len = max(0, min(r[i], r[i + 1]) - max(l[i], l[i + 1]) + 1);       int tmp = 1LL * pow_mod(r[i] - l[i] + 1, MOD - 2) *                 pow_mod(r[i + 1] - l[i + 1] + 1, MOD - 2) % MOD;       P[i] = (1 + MOD - 1LL * tmp * len % MOD) % MOD;     }     for (int i = 1; i < n; i++) S[i] = (P[i] + S[i - 1]) % MOD;     int ans = (3LL * S[n - 1] % MOD + 1) % MOD;     for (int i = 1; i + 2 < n; i++)       ans = (ans + 2LL * (S[n - 1] + MOD - S[i + 1]) % MOD * P[i] % MOD) % MOD;     for (int i = 1; i + 1 < n; i++) {       int len = max(0, min(r[i], min(r[i + 1], r[i + 2])) -                            max(l[i], max(l[i + 1], l[i + 2])) + 1);       int tmp = 1LL * pow_mod(r[i] - l[i] + 1, MOD - 2) % MOD *                 pow_mod(r[i + 1] - l[i + 1] + 1, MOD - 2) % MOD *                 pow_mod(r[i + 2] - l[i + 2] + 1, MOD - 2) % MOD;       int del = 1;       del = ((del + P[i]) % MOD + MOD - 1) % MOD;       del = ((del + P[i + 1]) % MOD + MOD - 1) % MOD;       del = (del + 1LL * tmp * len % MOD) % MOD;       ans = (ans + 2LL * del % MOD) % MOD;     }     printf( %d n , ans);   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2005;   int n, m, x[N], y[N], xx[N], yy[N], num[N][N], vis[N * N], cur, pre[N * N];   vector<int> v[N * N];   using pii = pair<int, int>;   vector<pair<int, pii>> process(vector<pair<int, pii>> q) {     sort(q.begin(), q.end());     vector<pair<int, pii>> ret;     for (int i = 0; i < int(q.size()); i++) {       int l = q[i].second.first, r = q[i].second.second, j = i + 1;       while (j < int(q.size()) && q[i].first == q[j].first) {         if (q[j].second.first > r) {           ret.push_back({q[i].first, {l, r}});           l = q[j].second.first;           r = q[j].second.second;         } else           r = max(r, q[j].second.second);         ++j;       }       ret.push_back({q[i].first, {l, r}});       i = j - 1;     }     return ret;   }   bool in(int a, pii y) { return a >= y.first && a <= y.second; }   bool check(int mid) {     mid *= 2;     vector<pair<int, pii>> a, b;     for (int i = 1; i <= n; i++) b.push_back({x[i], {y[i] - mid, y[i] + mid}});     for (int i = 1; i <= m; i++) a.push_back({yy[i], {xx[i] - mid, xx[i] + mid}});     a = process(a);     b = process(b);     for (int i = 0; i < int(a.size()); i++)       for (int j = 0; j < int(b.size()); j++) num[i][j] = -1;     int idx = 0;     for (int i = 0; i < n * m; i++) v[i].clear();     for (int i = 0; i < int(a.size()); i++) {       int lst = -1;       for (int j = 0; j < int(b.size()); j++)         if (in(a[i].first, b[j].second) && in(b[j].first, a[i].second)) {           num[i][j] = idx++;           if (lst != -1) v[lst].push_back(idx - 1), v[idx - 1].push_back(lst);           lst = idx - 1;         }     }     for (int i = 0; i < int(b.size()); i++) {       int lst = -1;       for (int j = 0; j < int(a.size()); j++)         if (in(a[j].first, b[i].second) && in(b[i].first, a[j].second)) {           if (lst != -1) v[lst].push_back(num[j][i]), v[num[j][i]].push_back(lst);           lst = num[j][i];         }     }     ++cur;     for (int i = 0; i < idx; i++)       if (vis[i] != cur) {         queue<int> q;         q.push(i);         pre[i] = -1;         vis[i] = cur;         while (!q.empty()) {           int nd = q.front();           q.pop();           for (auto &i : v[nd]) {             if (vis[i] != cur)               q.push(i), vis[i] = cur, pre[i] = nd;             else if (pre[nd] != i)               return 1;           }         }       }     return 0;   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> m;     int t1, t2;     for (int i = 1; i <= n; i++) cin >> t1 >> t2, x[i] = t1 + t2, y[i] = t1 - t2;     for (int i = 1; i <= m; i++)       cin >> t1 >> t2, xx[i] = t1 + t2, yy[i] = t1 - t2;     int l = 1, r = 1000000000, ans = -1;     while (l <= r) {       int mid = (l + r) >> 1;       if (check(mid))         ans = mid, r = mid - 1;       else         l = mid + 1;     }     if (ans == -1)       cout <<  Poor Sereja!  << endl;     else       cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using namespace placeholders;   template <class T>   void mini(T &l, T r) {     l = min(l, r);   }   template <class T>   void maxi(T &l, T r) {     l = max(l, r);   }   template <class TH>   void _dbg(const char *sdbg, TH h) {     cerr << sdbg <<  =  << h <<   n ;   }   template <class TH, class... TA>   void _dbg(const char *sdbg, TH h, TA... a) {     while (*sdbg !=  , ) cerr << *sdbg++;     cerr <<  =  << h <<  , ;     _dbg(sdbg + 1, a...);   }   template <class T>   ostream &operator<<(ostream &os, vector<T> V) {     os <<  [ ;     for (auto vv : V) os << vv <<  , ;     return os <<  ] ;   }   template <class L, class R>   ostream &operator<<(ostream &os, pair<L, R> P) {     return os <<  (  << P.first <<  ,  << P.second <<  ) ;   }   const int N = 2E2 + 10;   int a[N][N];   void output(int n) {     printf( %d n , n);     for (int i = 0; i <= n; ++i) printf( %d%c , a[n][i],   n  [i < n]);   }   int main() {     int n;     scanf( %d , &n);     a[0][0] = 1;     a[1][0] = 0, a[1][1] = 1;     for (int i = 2; i <= n; ++i) {       for (int j = 0; j < n; ++j) a[i][j + 1] = a[i - 1][j];       for (int j = 0; j < n - 1; ++j) a[i][j] = a[i][j] + a[i - 2][j] & 1;     }     output(n);     output(n - 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct temp {     unordered_map<long long, int> mp;   };   int main() {     ios_base::sync_with_stdio(false);     long long sum = 0, ans = 0;     vector<int> val(26);     string str;     temp mpc[26];     for (int i = 0; i < 26; i++) cin >> val[i];     cin >> str;     for (int i = 0; i < str.size(); i++) {       int ch = str[i] -  a ;       if (mpc[ch].mp[sum] != 0) ans += mpc[ch].mp[sum];       sum += val[ch];       mpc[ch].mp[sum]++;     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string tos(int a) {     ostringstream os(  );     os << a;     return os.str();   }   const int MAXN = 1000000;   bool isp[MAXN + 100];   int main() {     ios_base::sync_with_stdio(0);     for (int i = 0; i <= MAXN; ++i) isp[i] = 1;     isp[0] = isp[1] = 1;     for (int i = 2; i <= MAXN; ++i)       if (isp[i])         for (int j = i + i; j <= MAXN; j += i) isp[j] = 0;     int n;     while (cin >> n) {       int x, y;       for (int i = 2; i < MAXN; ++i) {         x = i, y = n - x;         if (!isp[x] && !isp[y]) break;       }       cout << x <<     << y <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     int n;     cin >> n;     vector<int> a(n + 1);     vector<int> primes = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,                           31, 37, 41, 43, 47, 53, 59, 61, 67};     const int MAX = 70;     vector<int> cnt(MAX + 1);     for (int i = 1; i <= n; ++i) {       cin >> a[i];       ++cnt[a[i]];     }     const int NS = 1 << primes.size();     vector<vector<int>> nw(MAX + 1, vector<int>(NS));     nw[0][0] = 1;     for (int i = 1; i <= MAX; ++i) {       int t = i;       int mask = 0;       for (int j = 0; j < primes.size(); ++j) {         mask <<= 1;         while (t % primes[j] == 0) {           mask ^= 1;           t /= primes[j];         }       }       long long E = 1;       for (int j = 1; j < cnt[i]; ++j) {         E = E * 2 % MOD;       }       long long O = 0;       if (cnt[i]) O = E;       for (int j = 0; j < NS; ++j) {         nw[i][j] = nw[i - 1][j] * E % MOD;         int pv = j ^ mask;         nw[i][j] = (nw[i][j] + nw[i - 1][pv] * O) % MOD;       }     }     long long ans = nw[MAX][0] - 1;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     int x, y;     while (cin >> x >> y) {       while (true) {         bool ok = false;         if (x >= 2 && y >= 2) {           x -= 2;           y -= 2;           ok = true;         } else if (x >= 1 && y >= 12) {           x--;           y -= 12;           ok = true;         } else if (y >= 22) {           y -= 22;           ok = true;         }         if (!ok) {           cout <<  Hanako  << endl;           break;         }         ok = false;         if (y >= 22) {           y -= 22;           ok = true;         } else if (x >= 1 && y >= 12) {           x--;           y -= 12;           ok = true;         } else if (x >= 2 && y >= 2) {           x -= 2;           y -= 2;           ok = true;         }         if (!ok) {           cout <<  Ciel  << endl;           break;         }       }     }     return 0;   }