malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   int cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }   int main() {     char str[100005];     int i, j, k;     scanf( %s , str);     int l = strlen(str);     int cB = 0, cb = 0, cu = 0, ca = 0, cs = 0, cr = 0, cl = 0;     for (i = 0; i < l; i++) {       if (str[i] ==  B ) {         cB++;       } else if (str[i] ==  b ) {         cb++;       } else if (str[i] ==  u ) {         cu++;       } else if (str[i] ==  a ) {         ca++;       } else if (str[i] ==  s ) {         cs++;       } else if (str[i] ==  l ) {         cl++;       } else if (str[i] ==  r ) {         cr++;       } else {         continue;       }     }     int arry[5];     arry[0] = cB;     arry[1] = cs;     arry[2] = cr;     arry[3] = cl;     arry[4] = cb;     qsort(arry, 5, sizeof(int), cmp);     int m1 = arry[0];     int m2;     if (cu <= ca) {       m2 = cu;     } else {       m2 = ca;     }     int ans;     if (m2 >= 2 * m1) {       ans = m1;     } else if (m2 < 2 * m1) {       ans = m2 / 2;     }     printf( %d n , ans);     return (0);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     for (int i = 0; i < t; i++) {       int n;       cin >> n;       int a[n];       for (int j = 1; j <= n; j++) {         a[j] = pow(2, j);       }       int f = 0, s = 0;       for (int j = 1; j <= n; j++) {         if (j < n / 2 || j == n)           f += a[j];         else {           s += a[j];         }       }       cout << f - s << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, a[100], b[100];     scanf( %d %d , &n, &m), a[0] = n - 2, b[0] = m - 2;     for (int i = 1; i < max(n, m); i++) a[i] = b[i] = 2;     if (n == 1)       a[0] = 1;     else if (n == 2)       a[0] = 3, a[1] = 4;     if (m == 1)       b[0] = 1;     else if (m == 2)       b[0] = 3, b[1] = 4;     for (int i = 0; i < n; i++, putchar(10))       for (int j = 0; j < m; j++) printf( %d  , a[i] * b[j]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const int MAXN = 1111111;   const int N = 105;   const int M = 25;   int cmp(int a, int b) { return a > b; }   int n, m, s[N], c[M], t[M], dp[MAXN], st;   void init() {     memset(dp, INF, sizeof(dp));     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , &s[i]);     scanf( %d%*c , &m);     for (int j = 0; j < m; j++) scanf( %c%*c%d%*c , &c[j], &t[j]);   }   int DP(int state, int num) {     if (dp[state] != INF) return dp[state];     int &ans = dp[state];     ans = 0;     if (c[num] ==  p ) {       int bit;       for (bit = 0; bit < m; bit++)         if ((state & (1 << bit))) break;       if (t[num] == 1)         ans = (DP((state ^ (1 << bit)), num + 1) + s[bit]);       else         ans = (DP((state ^ (1 << bit)), num + 1) - s[bit]);     } else if (c[num] ==  b ) {       if (t[num] == 1)         ans = -INF;       else         ans = INF;       for (int i = 0; i < m; i++) {         if ((state & (1 << i))) {           if (t[num] == 1)             ans = (ans) > (DP((state ^ (1 << i)), num + 1))                       ? (ans)                       : (DP((state ^ (1 << i)), num + 1));           else             ans = (ans) < (DP((state ^ (1 << i)), num + 1))                       ? (ans)                       : (DP((state ^ (1 << i)), num + 1));         }       }     }     return ans;   }   void solve() {     sort(s, s + n, cmp);     st = (1 << m) - 1;     printf( %d n , DP(st, 0));   }   int main() {     init();     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long a[] = {0, 1, 2, 9, 64, 625, 7776, 117649, 2097152};   const long long M = 1000000007ll;   int main(void) {     std::ios::sync_with_stdio(false);     long long k, n, m, t;     while (cin >> n >> m) {       n -= m;       t = 1;       k = n;       while (k) {         if (k & 1) t = t * n % M;         n = n * n % M;         k >>= 1;       }       cout << a[m] * t % M << endl;     }     return 0;   }
#include <bits/stdc++.h>   const long long N = 1e5 + 5;   using namespace std;   struct node {     long long sum[10], lazy[10];   } lv[4 * N];   long long n, a[N], q;   void init(long long i, long long l, long long r) {     for (long long k = 0; k < 10; k++) lv[i].lazy[k] = k;     if (l == r) {       long long x = 1, z;       while (a[l] != 0) {         z = a[l] % 10;         lv[i].sum[z] += x;         x *= 10;         a[l] /= 10;       }       return;     }     long long mid = (l + r) / 2;     init(i * 2, l, mid);     init(i * 2 + 1, mid + 1, r);     for (long long k = 0; k < 10; k++)       lv[i].sum[k] = lv[i * 2].sum[k] + lv[i * 2 + 1].sum[k];   }   void dolazy(long long i, long long l, long long r) {     if (l != r) {       for (long long k = 0; k < 10; k++) {         lv[i * 2].lazy[k] = lv[i].lazy[lv[i * 2].lazy[k]];         lv[i * 2 + 1].lazy[k] = lv[i].lazy[lv[i * 2 + 1].lazy[k]];       }     }     long long cur[10];     for (long long k = 0; k < 10; k++) cur[k] = 0;     for (long long k = 0; k < 10; k++) cur[lv[i].lazy[k]] += lv[i].sum[k];     for (long long k = 0; k < 10; k++) lv[i].sum[k] = cur[k], lv[i].lazy[k] = k;   }   void update(long long i, long long l, long long r, long long L, long long R,               long long x, long long y) {     dolazy(i, l, r);     if (L > r || l > R) return;     if (L <= l && r <= R) {       lv[i].lazy[x] = y;       dolazy(i, l, r);       return;     }     long long mid = (l + r) / 2;     update(i * 2, l, mid, L, R, x, y);     update(i * 2 + 1, mid + 1, r, L, R, x, y);     for (long long k = 0; k < 10; k++)       lv[i].sum[k] = lv[i * 2].sum[k] + lv[i * 2 + 1].sum[k];   }   long long get(long long i, long long l, long long r, long long L, long long R) {     dolazy(i, l, r);     if (L > r || l > R) return 0;     if (L <= l && r <= R) {       long long ans = 0;       for (int k = 0; k < 10; k++) ans += lv[i].sum[k] * k;       return ans;     }     long long mid = (l + r) / 2;     return get(i * 2, l, mid, L, R) + get(i * 2 + 1, mid + 1, r, L, R);   }   int main() {     cin >> n >> q;     for (long long i = 1; i <= n; i++) cin >> a[i];     init(1, 1, n);     while (q--) {       long long query, l, r, x, y;       cin >> query >> l >> r;       if (query == 1) {         cin >> x >> y;         update(1, 1, n, l, r, x, y);       } else {         cout << get(1, 1, n, l, r) <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   void init() { return; }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     init();     int n;     cin >> n;     long long int a[n];     for (int i = 0; i < n; i++) {       cin >> a[i];     }     long long int ans = 0ll, prev = 0ll;     for (int i = 0; i < n; i++) {       long long int temp1 = min(a[i] / 2, prev);       long long int temp2 = (a[i] - 2 * temp1) / 3;       ans += temp1 + temp2;       prev += a[i] - 3 * (temp1 + temp2);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, t;     cin >> n >> m;     vector<int> f;     for (int i = 0; i < m; i++) {       cin >> t;       f.insert(f.begin(), t);     }     for (int i = 0; i < m; i++) {       t = i;       for (int j = i + 1; j < m; j++)         if (f[j] > f[t]) t = j;       swap(f[i], f[t]);     }     t = f[0] - f[n - 1];     for (int i = 0; i < m - n + 1; i++) {       if ((f[i] - f[i + n - 1]) < t) t = f[i] - f[i + n - 1];     }     cout << t;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int ALL = (1 << 30) - 1;   int ans[(1 << 22) + 10];   int a[int(1e6) + 2];   int n;   void add(int x, int val) {     if (ans[x] != 0) return;     ans[x] = val;     for (int i = 0; i < 22; ++i) add(x & (ALL - (1 << i)), val);   }   void task() {     scanf( %d , &n);     for (int i = 0; i < n; ++i) scanf( %d , &a[i]);     for (int i = 0; i < n; ++i) {       int x = 0;       for (int j = 0; j < 22; ++j)         if (!(a[i] & (1 << j))) x += 1 << j;       add(x, a[i]);     }     for (int i = 0; i < n; ++i) printf( %d  , ans[a[i]] ? ans[a[i]] : -1);   }   int main() {     task();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n;     string s;     cin >> s;     int l = s.length(), ct = 1;     for (int i = 1; i < l; i++) {       if (s[i] != s[i - 1]) ct++;     }     if (ct >= (n - 1))       cout << n;     else       cout << ct + 2;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 4e5 + 10;   const int inf = 1e9;   int main() {     ios::sync_with_stdio(false);     string s;     cin >> s;     s =     + s;     int i;     int ans = 0;     int sum = 0;     for (i = 1; i < (int)s.size(); i++) {       if (s[i] ==  M ) {         sum++;       }       if (s[i] ==  F  && sum > 0) {         ans = max(ans + 1, sum);       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int a, b, c, d, e, f;     cin >> a >> b >> c >> d >> e >> f;     long long int minbcd;     minbcd = min(b, min(c, d));     long long int cnt;     cnt = minbcd * f;     long long int x;     x = d - minbcd;     cnt = cnt + (min(x, a) * e);     long long int minad;     minad = min(a, d);     long long int cnt1;     cnt1 = minad * e;     long long int y;     y = d - minad;     long long int minbcy;     minbcy = min(b, min(c, y));     cnt1 = cnt1 + (minbcy * f);     if (cnt >= cnt1)       cout << cnt;     else       cout << cnt1;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char inp1[100005];   char inp2[100005];   char res[100005];   bool mk[100005];   bool mk1[100005];   char getDiff(char a, char b, char c) {     for (int i = 0; i < 26; i++)       if (a != ( a  + i) && b != ( a  + i) && c != ( a  + i)) return ( a  + i);     return -1;   }   int main() {     int n, t, s = 0;     cin >> n >> t;     cin >> inp1 >> inp2;     memset(mk, 0, sizeof mk);     memset(mk1, 0, sizeof mk1);     for (int i = 0; i < n; i++)       if (inp1[i] != inp2[i]) s++;     res[n] =   0 ;     if (s > 2 * t) {       cout << -1 << endl;       return 0;     }     if (s <= 2 * t && s >= t) {       int c = 0;       for (int i = 0; i < n; i++)         if (inp1[i] != inp2[i] && c < t) mk[i] = true, c++;       c = 0;       for (int i = n - 1; i >= 0; i--)         if (inp1[i] != inp2[i] && c < t) mk1[i] = true, c++;       for (int i = 0; i < n; i++) {         if (mk[i] == true && mk1[i] == true)           res[i] = getDiff(inp1[i], inp2[i], 0);         else if (mk[i])           res[i] = inp2[i];         else if (mk1[i])           res[i] = inp1[i];         else           res[i] = inp1[i];       }       cout << res << endl;       return 0;     }     if (s < t) {       int c = 0;       for (int i = 0; i < n; i++) {         if (inp1[i] != inp2[i]) res[i] = getDiff(inp1[i], inp2[i], 0), c++;       }       for (int i = 0; i < n; i++) {         if (inp1[i] == inp2[i] && c < t)           res[i] = getDiff(inp1[i], inp2[i], 0), c++;         else if (inp1[i] == inp2[i])           res[i] = inp1[i];       }       cout << res << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int m, n, k;   pair<long long, long long> ptsx[100005];   pair<long long, long long> ptsy[100005];   bool removed[100005];   long long get(int l, int r, int u, int d, int dep) {     while (removed[ptsx[l].second]) l++;     while (removed[ptsx[r].second]) r--;     while (removed[ptsy[u].second]) u++;     while (removed[ptsy[d].second]) d--;     if (dep == k) {       long long xd = ptsx[r].first - ptsx[l].first;       long long yd = ptsy[d].first - ptsy[u].first;       if (xd == 0) xd++;       if (yd == 0) yd++;       return ((xd + 1) / 2) * ((yd + 1) / 2);     }     long long ans = (1LL) << 62;     removed[ptsx[l].second] = true;     ans = min(ans, get(l + 1, r, u, d, dep + 1));     removed[ptsx[l].second] = false;     removed[ptsx[r].second] = true;     ans = min(ans, get(l, r - 1, u, d, dep + 1));     removed[ptsx[r].second] = false;     removed[ptsy[u].second] = true;     ans = min(ans, get(l, r, u + 1, d, dep + 1));     removed[ptsy[u].second] = false;     removed[ptsy[d].second] = true;     ans = min(ans, get(l, r, u, d - 1, dep + 1));     removed[ptsy[d].second] = false;     return ans;   }   int main() {     ios_base::sync_with_stdio(0);     cout << fixed << setprecision(12);     cin >> n >> k;     for (int i = 0, _i = (n); i < _i; ++i) {       int x1, y1, x2, y2;       cin >> x1 >> y1 >> x2 >> y2;       ptsx[i] = make_pair(x1 + x2, i);       ptsy[i] = make_pair(y1 + y2, i);     }     sort(ptsx, ptsx + n);     sort(ptsy, ptsy + n);     cout << get(0, n - 1, 0, n - 1, 0) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using ld = long double;   using pii = pair<int, int>;   using pil = pair<int, ll>;   using pli = pair<ll, int>;   using pll = pair<ll, ll>;   const ll MOD = 1e9 + 7;   const int inf = (1 << 30) - 1;   const ll INF = (1LL << 60) - 1;   const ld EPS = 1e-10;   template <typename T>   bool chmax(T &x, const T &y) {     return (x < y) ? (x = y, true) : false;   };   template <typename T>   bool chmin(T &x, const T &y) {     return (x > y) ? (x = y, true) : false;   };   int main() {     int T;     cin >> T;     while (T--) {       int N, K, L;       cin >> N >> K >> L;       int d[N];       for (int i = 0; i < N; i++) {         cin >> d[i];         d[i] = L - d[i];       }       int pos = -inf;       bool ans = true;       for (int i = 0; i < N; i++) {         if (d[i] < 0) {           ans = false;           break;         } else if (d[i] >= K)           pos = -inf;         else if (pos == -inf)           pos = -d[i];         else if (d[i] <= pos) {           ans = false;           break;         } else if (pos < -d[i])           pos = -d[i];         else           pos++;       }       cout << (ans ?  Yes  :  No ) << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   set<long long> f, l, s;   long long sf = 0, sl = 0;   long long ksum = 0, cnt = 0, kmin = 0;   void update(long long b, long long t) {     int c = l.size();     if (t == 1)       s.insert(b);     else       s.erase(b);     if (c == 1 && cnt == 0) {       ksum = kmin = *s.rbegin();       cnt = 1;       return;     }     if (c > cnt) {       if (b > kmin) {         ksum += b;       } else {         kmin = *(--s.find(kmin));         ksum += kmin;       }       cnt++;     } else if (c < cnt) {       ksum -= max(b, kmin);       if (b <= kmin) {         kmin = *s.upper_bound(kmin);       }       cnt--;     } else {       if (c == 0) return;       if (b >= kmin) {         if (t == 1) {           ksum += b - kmin;           kmin = *s.upper_bound(kmin);         } else {           kmin = *(--s.lower_bound(kmin));           ksum -= b - kmin;         }       }     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     while (n--) {       long long a, b;       cin >> a >> b;       if (a == 0) {         if (b < 0) {           f.erase(f.find(-b));         } else {           f.insert(b);         }         sf += b;       } else {         if (b < 0) {           l.erase(l.find(-b));         } else {           l.insert(b);         }         sl += b;       }       if (b < 0)         update(-b, -1);       else         update(b, 1);       if (l.size() == 0) {         cout << sf << endl;       } else if (f.size() == 0) {         cout << 2 * sl - *l.begin() << endl;       } else {         if (*f.rbegin() > *l.begin()) {           cout << sf + sl + ksum << endl;         } else {           cout << sf + 2 * sl - *l.begin() + *f.rbegin() << endl;         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     scanf( %d , &t);     int ji = 0;     while (t--) {       int n;       scanf( %d , &n);       int arr[n + 1];       int brr[n + 1];       memset(arr, 0, sizeof(arr));       memset(brr, 0, sizeof(brr));       int ls;       int size = 0;       for (int a = 0; a < n; a++) {         scanf( %d , &ls);         if (arr[ls] == 0) {           brr[size] = ls;           size++;         }         arr[ls]++;       }       int min = n;       for (int a = 0; a < size; a++) {         if (arr[brr[a]] < min) {           min = arr[brr[a]];         }       }       int num = n;       int bo = true;       for (int a = 2; a < min + 2; a++) {         ls = 0;         bo = true;         for (int b = 0; b < size; b++) {           int tt = arr[brr[b]] / a + 1;           if (arr[brr[b]] % a == 0) {             ls = ls + arr[brr[b]] / a;           } else if (arr[brr[b]] >= (tt * (a - 1)) && arr[brr[b]] <= (tt * a)) {             ls = ls + tt;           } else {             bo = false;             break;           }         }         if (bo && num > ls) {           num = ls;         }       }       printf( %d n , num);     }   }
#include <bits/stdc++.h>   int n, k, m, c, arr[100005], ans;   inline void check() {     int i = 0;     while (i < m) {       if (arr[i] == i + 1)         i++;       else         break;     }     if (i)       c += (m - i + 1), ans += (m - i);     else       c += m, ans += (m - 1);   }   int main() {     scanf( %d %d , &n, &k);     ans = c = 0;     while (k--) {       scanf( %d , &m);       for (int i = 0; i < m; ++i) scanf( %d , &arr[i]);       check();     }     ans += (c - 1);     printf( %d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-10;   struct point {     double x, y;   };   struct segment {     double a, b, c;   };   point operator+(point a, point b) { return (point){a.x + b.x, a.y + b.y}; }   point operator-(point a, point b) { return (point){a.x - b.x, a.y - b.y}; }   double operator*(point a, point b) { return a.x * b.x + a.y * b.y; }   double operator/(point a, point b) { return a.x * b.y - a.y * b.x; }   point operator*(point a, double b) { return (point){a.x * b, a.y * b}; }   point operator/(point a, double b) { return (point){a.x / b, a.y / b}; }   int T;   point I, J, K, L;   segment midline(point A, double a, double b) {     segment line;     line.a = b;     line.b = -a;     line.c = -(A.x * line.a + A.y * line.b);     return line;   }   point getpoint(segment A, segment B) {     point C;     C.x = (-A.c * B.b + B.c * A.b) / (A.a * B.b - B.a * A.b);     C.y = (-A.a * B.c + B.a * A.c) / (A.a * B.b - B.a * A.b);     return C;   }   point mirror(point A, point B) {     point C;     C = A + (B - A) * 2;     return C;   }   int zero1(double x) { return x > eps; }   int zero0(double x) { return x < -eps; }   int solve(point A, point B, point C) {     point D, E, F, G, H;     point IJ, JK, KL, LI;     segment lineAC, lineBC, lineD, lineE, lineHG;     bool ans;     ans = false;     lineAC = (segment){A.y - C.y, C.x - A.x, A / C};     lineBC = (segment){B.y - C.y, C.x - B.x, B / C};     D = (A + C) / 2;     E = (B + C) / 2;     lineD = midline(D, lineAC.a, lineAC.b);     lineE = midline(E, lineBC.a, lineBC.b);     F = getpoint(lineD, lineE);     G = mirror(E, C);     H = mirror(F, C);     lineHG = (segment){H.y - G.y, G.x - H.x, H / G};     I = getpoint(lineHG, lineD);     J = mirror(I, C);     K = mirror(J, B);     L = mirror(I, A);     IJ = J - I;     JK = K - J;     KL = L - K;     LI = I - L;     if (zero1(IJ / JK) && zero1(JK / KL) && zero1(KL / LI) && zero1(LI / IJ))       ans = true;     if (zero0(IJ / JK) && zero0(JK / KL) && zero0(KL / LI) && zero0(LI / IJ))       ans = true;     return ans;   }   void print() {     printf( YES n%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf n , I.x, I.y,            J.x, J.y, K.x, K.y, L.x, L.y);   }   int main() {     point A, B, C;     scanf( %d , &T);     while (T--) {       scanf( %lf%lf%lf%lf%lf%lf , &A.x, &A.y, &B.x, &B.y, &C.x, &C.y);       if (solve(A, B, C))         print();       else if (solve(A, C, B))         print();       else if (solve(B, C, A))         print();       else         printf( NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int a[111];   int memo[111][1 << 17];   pair<pair<int, int>, int> child[111][1 << 17];   int bt[66];   class MathFunction {    private:     long long sieve_size;     bitset<1010> bs;     vector<int> primes;       public:     int primeid[1010];     bool isPrime(long long N) {       if (N <= sieve_size) return bs[N];       for (int i = 0; i < (int)primes.size(); i++)         if (N % primes[i] == 0) return false;       return true;     }     void sieve(long long upperbound) {       sieve_size = upperbound + 1;       bs.set();       bs[0] = bs[1] = 0;       for (long long i = 2; i < sieve_size; i++) {         if (bs[i]) {           for (long long j = i * i; j < sieve_size; j += i) bs[j] = 0;           primeid[(int)i] = primes.size();           primes.push_back((int)i);         }       }     }     vector<int> primeFactors(long long N) {       vector<int> factors;       long long idx = 0, pf = primes[idx];       while (N != 1 && (pf * pf <= N)) {         while (N % pf == 0) {           N /= pf;           factors.push_back(pf);         }         pf = primes[++idx];       }       if (N != 1) factors.push_back(N);       return factors;     }   };   MathFunction mat;   int dp(int pos, int bitmask) {     if (pos == n) return 0;     if (memo[pos][bitmask] >= 0) return memo[pos][bitmask];     int q = abs(1 - a[pos]) + dp(pos + 1, bitmask);     child[pos][bitmask] =         pair<pair<int, int>, int>(pair<int, int>(pos + 1, bitmask), 1);     for (int i = 2; i < a[pos] + a[pos]; i++) {       if ((bitmask & bt[i]) == 0) {         int d = abs(i - a[pos]) + dp(pos + 1, bitmask | bt[i]);         if (d < q) {           q = d;           child[pos][bitmask] = pair<pair<int, int>, int>(               pair<int, int>(pos + 1, bitmask | bt[i]), i);         }       }     }     return memo[pos][bitmask] = q;   }   void printAns(int pos, int bitmask) {     if (pos == n) return;     pair<int, int> nx = child[pos][bitmask].first;     int val = child[pos][bitmask].second;     printf( %d  , val);     printAns(nx.first, nx.second);   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);     }     mat.sieve(100);     bt[1] = 0;     for (int i = 2; i <= 61; i++) {       vector<int> v = mat.primeFactors(i);       int b = 0;       for (int j = 0; j < v.size(); j++) {         if (mat.primeid[v[j]] <= 15) b |= (1 << mat.primeid[v[j]]);       }       bt[i] = b;     }     memset(memo, -1, sizeof memo);     dp(0, 0);     printAns(0, 0);     return 0;   }