malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 100005;   const int MOD = 1000000007;   int x[3], y[3];   pair<int, int> p;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     for (int i = (0); i <= (2); i++) cin >> x[i] >> y[i];     int ans = INT_MAX;     for (int i = (0); i <= (1000); i++) {       for (int j = (0); j <= (1000); j++) {         int cur = 0;         for (int k = (0); k <= (2); k++) cur += abs(x[k] - i) + abs(y[k] - j);         if (cur < ans) {           ans = cur;           p = pair<int, int>(i, j);         }       }     }     int cnt = 0;     ans++;     cout << ans <<   n ;     for (int k = (0); k <= (2); k++) {       if (p.first <= x[k]) {         for (int i = (p.first); i <= (x[k]); i++)           if (pair<int, int>(i, y[k]) != p) {             cout << i <<     << y[k] <<   n ;             cnt++;           }       } else {         for (int i = (x[k]); i <= (p.first); i++)           if (pair<int, int>(i, y[k]) != p) {             cout << i <<     << y[k] <<   n ;             cnt++;           }       }       if (p.second <= y[k]) {         for (int j = (p.second); j <= (y[k] - 1); j++)           if (pair<int, int>(p.first, j) != p) {             cout << p.first <<     << j <<   n ;             cnt++;           }       } else {         for (int j = (y[k] + 1); j <= (p.second); j++)           if (pair<int, int>(p.first, j) != p) {             cout << p.first <<     << j <<   n ;             cnt++;           }       }     }     cout << p.first <<     << p.second <<   n ;     assert(cnt == ans - 1);   }
#include <bits/stdc++.h>   using namespace std;   const int MN = 200005;   int N, M;   int A[MN];   int main() {     scanf( %d %d , &N, &M);     for (int i = 1; i <= N; i++) scanf( %d , &A[i]);     sort(A + 1, A + 1 + N);     while (M--) {       int X, Sol = 0;       scanf( %d , &X);       for (int it = 1 << 18; it; it /= 2)         if (Sol + it <= N && A[Sol + it] <= X) Sol += it;       printf( %d  , Sol);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int t, memo[402][402][402], idx, n, m;   string x, y;   void read(string &s) {     char c[404];     scanf( %s , c);     s = c;   }   int dp(int i, int j, int k) {     if (i == n) {       if (k == m)         return j;       else         return -10;     }     int &ret = memo[i][j][k];     if (ret != -1) return ret;     ret = dp(i + 1, j, k);     if (j < m) {       if (x[i] == y[j]) {         ret = max(ret, dp(i + 1, j + 1, k));       }     }     if (k < m) {       if (x[i] == y[k]) {         ret = max(ret, dp(i + 1, j, k + 1));       }     }     return ret;   }   int main() {     scanf( %d , &t);     while (t--) {       read(x);       read(y);       n = x.size();       m = y.size();       for (int i = 0; i < n + 2; i++) {         for (int j = 0; j < m + 2; j++) {           for (int k = 0; k < m + 2; k++) {             memo[i][j][k] = -1;           }         }       }       bool b = 0;       for (int i = 0; i < m; i++) {         idx = dp(0, 0, i);         if (i <= idx) {           b = 1;           break;         }       }       b ? printf( YES n ) : printf( NO n );     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int i, j, k, n, m, a1 = 0, a0 = 0, a2 = 0, c = 0, d;     vector<char> vc, s;     char a;     vector<long long int> vi;     while (cin >> a) {       s.push_back(a);     }     for (i = 0; i < s.size(); i++) {       if (s[i] ==  ( )         a1++;       else if (s[i] ==  ) )         a2++;       else         a0++;     }     if (a1 < a2 + a0) {       cout << -1 << endl;       return 0;     }     d = a1 - a2;     a1 = 0;     a2 = 0;     for (i = 0; i < s.size(); i++) {       if (a1 < a2) {         cout << -1 << endl;         return 0;       }       if (s[i] ==  ( ) {         a1++;         vc.push_back( ( );       } else if (s[i] ==  ) ) {         a2++;         vc.push_back( ) );       } else if (s[i] ==  #  && a0 == 1) {         vi.push_back(d);         for (j = 0; j < d; j++) {           vc.push_back( ) );           a2++;         }       } else {         a2++;         d--;         a0--;         vc.push_back( ) );         vi.push_back(1);       }     }     for (i = 0; i < vi.size(); i++) {       cout << vi[i] << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, m, i;     cin >> n >> m;     i = n / 2 + (n & 1);     i = (m >= i) ? 0 : n - 2 * m;     cout << i <<    ;     if (!m) {       cout << n;       return 0;     }     for (i = 1; ((i * (i - 1)) / 2) < m; i++)       ;     cout << n - i;     return 0;   }
#include <bits/stdc++.h>   int a[100005] = {};   int b[100005] = {};   std::vector<int> ans;   std::vector<std::pair<int, int> > arr;   int main() {     std::ios_base::sync_with_stdio(false);     std::cin.tie(NULL);     std::cout.tie(NULL);     int n, li = -1;     std::cin >> n;     for (int i = 0; i < n; i++) {       std::cin >> a[i];       if (li == -1 || a[i] > a[li]) li = i;     }     for (int i = 0; i < n; i++) {       std::cin >> b[i];       if (i != li) arr.push_back(std::make_pair(a[i], i));     }     std::sort(arr.begin(), arr.end(), std::greater<std::pair<int, int> >());     for (int i = 0; i < arr.size(); i += 2) {       if (i == arr.size() - 1)         ans.push_back(arr[i].second + 1);       else {         if (b[arr[i].second] > b[arr[i + 1].second])           ans.push_back(arr[i].second + 1);         else           ans.push_back(arr[i + 1].second + 1);       }     }     ans.push_back(li + 1);     std::cout << ans.size() <<   n ;     for (std::vector<int>::iterator it = ans.begin(); it != ans.end(); it++) {       if (it != ans.begin()) std::cout <<    ;       std::cout << *it;     }     std::cout <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   char mp[1005][1005];   char p[4] = { A ,  B ,  C ,  D };   int n, m;   int main() {     int i, j, k;     while (scanf( %d%d , &n, &m) != EOF) {       for (i = 0; i < n; i++) scanf( %s , mp[i]);       bool flag = false;       for (i = 0; i < n; i++) {         for (j = 0; j < m; j++) {           if (mp[i][j] ==  w ) {             if (j + 2 < m && mp[i][j + 1] ==  b  && mp[i][j + 2] ==  w ) {               for (k = 0; k < 4; k++) {                 if (j > 0 && mp[i][j - 1] == p[k]) continue;                 if (i > 0 && mp[i - 1][j] == p[k]) continue;                 if (i > 0 && mp[i - 1][j + 1] == p[k]) continue;                 if (i > 0 && mp[i - 1][j + 2] == p[k]) continue;                 if (j + 3 < m && mp[i][j + 3] == p[k]) continue;                 break;               }               mp[i][j] = mp[i][j + 1] = mp[i][j + 2] = p[k];             } else if (i + 2 < n && mp[i + 1][j] ==  b  && mp[i + 2][j] ==  w ) {               for (k = 0; k < 4; k++) {                 if (i > 0 && mp[i - 1][j] == p[k]) continue;                 if (j > 0 && mp[i][j - 1] == p[k]) continue;                 if (j + 1 < m && mp[i][j + 1] == p[k]) continue;                 break;               }               mp[i][j] = mp[i + 1][j] = mp[i + 2][j] = p[k];             } else {               flag = true;               break;             }           }         }         if (flag) break;       }       if (flag)         puts( NO );       else {         puts( YES );         for (i = 0; i < n; i++) {           for (j = 0; j < m; j++) {             if (isupper(mp[i][j])) mp[i][j] = tolower(mp[i][j]);             putchar(mp[i][j]);           }           puts(  );         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, m, k, a;     scanf( %I64d%I64d%I64d , &n, &m, &k);     if (n + m - 2 < k)       printf( -1 );     else {       if (n > m) {         a = n;         n = m;         m = a;       }       if (n >= k + 1) {         printf( %I64d , max((m / (k + 1)) * n, (n / (k + 1)) * m));       } else {         if (m >= k + 1)           printf( %I64d , (m / (k + 1)) * n);         else           printf( %I64d , n / (k - m + 2));       }     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int r, c, n, k;     scanf( %d%d%d%d n , &r, &c, &n, &k);     int a[r][c];     for (int i = 0; i < r; i++) {       for (int j = 0; j < c; j++) {         a[i][j] = 0;       }     }     int x, y;     for (int i = 0; i < n; i++) {       scanf( %d %d n , &x, &y);       a[x - 1][y - 1] = 1;     }     int ans = 0, lsum;     for (int r1 = 0; r1 < r; r1++)       for (int r2 = r1 + 1; r2 < r + 1; r2++)         for (int c1 = 0; c1 < c; c1++)           for (int c2 = c1 + 1; c2 < c + 1; c2++) {             lsum = 0;             for (int i = r1; i < r2; i++)               for (int j = c1; j < c2; j++) lsum += a[i][j];             if (lsum >= k) ans++;           }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   bool solve(int *c, int *ans) {     if (c[5] || c[7]) return false;     while (c[3] > 0) {       c[3]--;       if (!c[1] || !c[6])         return false;       else {         c[1]--, c[6]--;         ans[2]++;       }     }     while (c[1] > 0) {       c[1]--;       if (!c[2])         return false;       else {         c[2]--;         if (!c[4] && !c[6]) return false;         if (c[4] > c[6]) {           c[4]--;           ans[0]++;         } else {           c[6]--;           ans[1]++;         }       }     }     for (int i = 0; i <= 7; ++i)       if (c[i] > 0) return false;     return true;   }   int main() {     int n, t, c[10] = {0};     scanf( %d , &n);     while (n--) {       scanf( %d , &t);       c[t]++;     }     int ans[4] = {0};     if (!solve(c, ans)) {       puts( -1 );     } else {       while (ans[0]--) puts( 1 2 4 );       while (ans[1]--) puts( 1 2 6 );       while (ans[2]--) puts( 1 3 6 );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long double det(long double x, long double y, long double z, long double t) {     return x * t - y * z;   }   long long int pow(long long int n, long long int m) {     if (m == 0) return 1;     if (m == 1) return n % (int)1e9 + 7;     long long int t = pow(n, m / 2) % (int)1e9 + 7;     if (m % 2 == 0)       return (t % (int)1e9 + 7 * t % (int)1e9 + 7) % (int)1e9 + 7;     else       return ((t % (int)1e9 + 7 * t % (int)1e9 + 7) % (int)1e9 +               7 * (n % (int)1e9 + 7)) %                  (int)1e9 +              7;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long int x, y, i, z = 1, q = 1;     cin >> x >> y;     if (x == 0) return cout << 0, 0;     x %= (int)1e9 + 7;     x *= 2;     x %= (int)1e9 + 7;     x -= 1;     if (y % 2) {       y -= 1;       q *= 2;     }     while (y > 0) {       z = 2;       for (i = 1; i <= (long long int)log2(y); i++) {         z *= z;         z %= (int)1e9 + 7;       }       y -= pow(2, (long long int)log2(y));       q *= z;       q %= (int)1e9 + 7;     }     long long int ans = q * x + 1;     while (ans >= (int)1e9 + 7) ans -= (int)1e9 + 7;     while (ans < 0) ans += (int)1e9 + 7;     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int main() {     multiset<int> Q;     scanf( %d , &n);     long long ans = 0;     for (int i = 0; i < n; i++) {       int x;       scanf( %d , &x);       if (Q.size() == 0 || (*Q.begin()) > x) {         Q.insert(x);       } else {         ans += x - *Q.begin();         Q.erase(Q.begin());         Q.insert(x);         Q.insert(x);       }     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using ll = long long;   using namespace std;   ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }   template <typename T>   void read(T &x) {     x = 0;     char ch = getchar();     ll f = 1;     while (!isdigit(ch)) {       if (ch ==  - ) f *= -1;       ch = getchar();     }     while (isdigit(ch)) {       x = x * 10 + ch - 48;       ch = getchar();     }     x *= f;   }   ll quick_pow(ll a, ll b, ll mod) {     ll ans = 1, base = a;     while (b) {       if (b & 1) ans = ans * base % mod;       base = base * base % mod;       b >>= 1;     }     return ans;   }   const int M = 5005;   char a[M], b[M];   int dp[M][M];   int main() {     int n, m;     read(n), read(m);     scanf( %s%s , a + 1, b + 1);     int ans = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (a[i] == b[j])           dp[i][j] = dp[i - 1][j - 1] + 2;         else           dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) - 1;         dp[i][j] = max(dp[i][j], 0);         ans = max(dp[i][j], ans);       }     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using pii = pair<int, int>;   using vi = vector<int>;   using ll = long long;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     vi count(3);     enum { R, B, G };     map<char, int> val = {{ R , R}, { B , B}, { G , G}};     int n;     cin >> n;     vi p(n), c(n);     for (int i = int(0); i < int(n); i++) {       cin >> p[i];       char col;       cin >> col;       int v = val[col];       count[v]++;       c[i] = v;     }     int ans = 0;     if (!count[R] || !count[B])       ans = p[n - 1] - p[0];     else {       vi last(3, -1), mx(2, -1), sum(2);       for (int i = int(0); i < int(n); i++) {         int col = c[i];         if (col == G) {           if (last[G] != -1) {             ll cut = 0, distG = p[i] - p[last[G]];             for (int j = int(0); j < int(2); j++)               if (mx[j] != -1) {                 mx[j] = max(mx[j], p[i] - p[last[j]]);                 cut += distG - mx[j], mx[j] = -1;                 sum[j] = 0;               }             ans += int(min(2 * distG, distG + cut));           } else {             for (int j = int(0); j < int(2); j++)               if (last[j] != -1) ans += p[i] - p[last[j]];           }         } else {           if (last[G] != -1) {             int dist = p[i] - p[last[mx[col] == -1 ? G : col]];             mx[col] = max(mx[col], dist);             sum[col] += dist;           } else if (last[col] != -1)             ans += p[i] - p[last[col]];         }         last[col] = i;       }       ans += sum[R] + sum[B];     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long cq, q, c[2000 + 10][2000 + 10], cg[2000 + 10][2000 + 10],       pos[2000 + 10], n, m, k, bl[2000 + 10][2000 + 10][3], cnt[2000 + 10];   template <class T>   bool Read(T &x) {     char c;     bool f = 0;     while (c = getchar(), c != EOF) {       if (c ==  - )         f = 1;       else if (c >=  0  && c <=  9 ) {         x = c -  0 ;         while (c = getchar(), c >=  0  && c <=  9 ) x = x * 10 + c -  0 ;         ungetc(c, stdin);         if (f) x = -x;         return 1;       }     }     return 0;   }   inline int lowbit(long long x) { return x & -x; }   inline void update(long long *c, int x, long long d) {     while (x <= m) {       c[x] += d;       x += lowbit(x);     }   }   inline void update(int x, int y, long long d) {     while (x <= n) {       update(c[x], y, d);       x += lowbit(x);     }   }   inline long long get_sum(long long *c, int x) {     long long ret = 0;     while (x) {       ret += c[x];       x ^= lowbit(x);     }     return ret;   }   inline long long get_sum(int x, int y) {     long long ret = 0;     while (x) {       ret += get_sum(c[x], y);       x ^= lowbit(x);     }     return ret;   }   struct Query {     int p, x1, x2, y1, y2;   } Q[1000000 + 10];   void read() {     Read(n), Read(m), Read(k);     int i, j;     for (i = 1; i <= k; i++) {       Read(cnt[i]);       for (j = 1; j <= cnt[i]; j++)         Read(bl[i][j][0]), Read(bl[i][j][1]), Read(bl[i][j][2]);     }     Read(q);     char s[20];     for (i = 1; i <= q; i++) {       scanf( %s , s);       if (*s ==  S ) {         Q[i].p = 1;         Read(Q[i].x1);       } else {         Q[i].p = 2;         Read(Q[i].x1), Read(Q[i].y1), Read(Q[i].x2), Read(Q[i].y2);         pos[++cq] = i;       }     }   }   bool vis[2000 + 10];   void solve() {     int i, j;     for (i = 1; i <= k; i++) {       for (j = 1; j <= cnt[i]; j++) update(bl[i][j][0], bl[i][j][1], bl[i][j][2]);       for (j = 1; j <= cq; j++)         cg[j][i] = get_sum(Q[pos[j]].x2, Q[pos[j]].y2) -                    get_sum(Q[pos[j]].x2, Q[pos[j]].y1 - 1) -                    get_sum(Q[pos[j]].x1 - 1, Q[pos[j]].y2) +                    get_sum(Q[pos[j]].x1 - 1, Q[pos[j]].y1 - 1);       for (j = 1; j <= cnt[i]; j++)         update(bl[i][j][0], bl[i][j][1], -bl[i][j][2]);     }     int cc = 0;     long long ans = 0;     for (i = 1; i <= q; i++) {       if (Q[i].p == 1)         vis[Q[i].x1] ^= 1;       else {         ans = 0;         cc++;         for (j = 1; j <= k; j++)           if (!vis[j]) ans += cg[cc][j];         printf( %I64d n , ans);       }     }   }   int main() {     read();     solve();   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 0.5;   const double pi = acos(-1.0);   const long long INF = 2e18;   const int maxn = 100005;   int main() {     int t;     scanf( %d , &t);     while (t--) {       int n;       scanf( %d , &n);       n = n + n;       double ans = cos(pi / (2.0 * n)) / (sin(pi / (1.0 * n)));       printf( %.10f n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int aa[1005];   int bb[1005];   long long wei(long long x) {     long long a = 0;     while (x) {       aa[a] = x % 10;       x /= 10;       a++;     }     return a;   }   long long wei2(long long x) {     long long a = 0;     while (x) {       bb[a] = x % 10;       x /= 10;       a++;     }     return a;   }   long long ksm(long long a, long long b) {     long long res = 1;     while (b) {       if (b % 2 == 1) res = res * a;       a = a * a;       b /= 2;     }     return res;   }   int main(int argc, char** argv) {     long long p, d;     cin >> p >> d;     int wp = wei(p);     int wd = wei2(d);     long long ans = 0;     long long u = wp, n = 0, pp = 0;     while (u) {       if (aa[u - 1] == 9) n++;       u--;     }     ans = max(ans, n);     n = 0;     u = wp;     while (u) {       if (aa[u - 1] == 9) n++;       ans = max(ans, n);       if (u > wp || p % ksm(10, u) >= d) {         u--;         continue;       }       int q = aa[u - 1] == 9 ? 1 : 0;       if (aa[u - 1] == 1) q--;       if (ans < n - q + u) {         pp = p % ksm(10, u) + 1;         ans = max(n - q + u, ans);       }       u--;     }     cout << p - pp;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int s, a, b, c;     cin >> s >> a >> b >> c;     if (a == 0 && b == 0 && c == 0) {       printf( %.10f %.10f %.10f n , s, 0, 0);     } else {       int sum = a + b + c;       printf( %.10f %.10f %.10f n , ((double)a * s) / sum, ((double)b * s) / sum,              ((double)c * s) / sum);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxS = 1 << 15;   const int mod = 1e9 + 7;   int n;   int a[65];   int d[65];   int s[15], tots;   int t[65], tott;   int in[65], cnt[maxS + 5];   int f[maxS + 5][65];   int ans, st;   namespace usual {   int C[65][65];   int add(int ta, int tb) { return ta + tb >= mod ? ta + tb - mod : ta + tb; }   int sub(int ta, int tb) { return ta < tb ? ta - tb + mod : ta - tb; }   void make_C() {     C[0][0] = 1;     for (int i = 1; i <= n; i++) {       C[i][0] = 1;       for (int j = 1; j <= n; j++) C[i][j] = add(C[i - 1][j], C[i - 1][j - 1]);     }   }   }  // namespace usual   using namespace usual;   namespace funi {   int fn[65];   void make_fn() {     for (int i = 1; i <= n; i++) fn[i] = i;   }   int find(int x) { return fn[x] == x ? x : fn[x] = find(fn[x]); }   void uni(int u, int v) {     int fu = find(u), fv = find(v);     if (u == v) return;     fn[fu] = fv;   }   }  // namespace funi   using namespace funi;   bool issub(int ta, int tb) { return (ta & tb) == ta; }   bool isint(int ta, int tb) { return (ta & tb) > 0; }   void clean() {     tots = tott = 0;     memset(in, 0, sizeof in);     memset(cnt, 0, sizeof cnt);     memset(f, 0, sizeof f);   }   int dp(int fir) {     clean();     for (int i = 1; i <= n; i++) {       if (find(i) != fir) continue;       if (d[i] == 0)         s[++tots] = i;       else         t[++tott] = i;     }     if (tott == 0) return 1;     for (int i = 1; i <= tott; i++)       for (int j = 1; j <= tots; j++)         if (a[t[i]] % a[s[j]] == 0) in[i] |= (1 << (j - 1));     for (int i = 0; i < (1 << (tots + 1 - 1)); i++)       for (int j = 1; j <= tott; j++)         if (issub(in[j], i)) cnt[i]++;     for (int i = 1; i <= tott; i++) f[in[i]][1]++;     for (int S = 0; S < (1 << (tots + 1 - 1)); S++)       for (int k = 1; k < tott; k++) {         if (f[S][k] == 0) continue;         for (int i = 1; i <= tott; i++)           if (!issub(in[i], S) && isint(in[i], S))             f[S | in[i]][k + 1] = add(f[S | in[i]][k + 1], f[S][k]);         f[S][k + 1] = add(f[S][k + 1], 1ll * f[S][k] * (cnt[S] - k) % mod);       }     return f[(1 << (tots + 1 - 1)) - 1][tott];   }   int main() {     scanf( %d , &n);     make_C();     make_fn();     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= n; j++)         if (a[i] % a[j] == 0 && i != j) {           uni(i, j);           d[i]++;         }     ans = 1;     for (int i = 1; i <= n; i++)       if (find(i) == i) {         ans = 1ll * ans * dp(i) % mod;         if (tott == 0) continue;         ans = 1ll * ans * C[st + tott - 1][tott - 1] % mod;         st += tott - 1;       }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     map<int, map<int, int>> solution;     solution[1000][999999000] = 474176509;     solution[1][1000000000] = 327451602;     solution[4][1000000000] = 433920973;     solution[750][1000000000] = 324554228;     solution[1000][1000000000] = 317623986;     solution[1000][1] = 0;     solution[750][199999900] = 888244974;     solution[997][150000000] = 200022425;     solution[1000][199999999] = 690144838;     solution[1000][200000000] = 503494344;     solution[1000][100000000] = 92326252;     solution[930][79942654] = 863722490;     solution[539][33557677] = 932232256;     solution[627][62695452] = 936496657;     solution[309][49646417] = 862961049;     solution[967][2755057] = 286009469;     solution[955][22071041] = 939711836;     solution[630][4012333] = 792227055;     solution[102][86546365] = 329533568;     solution[371][30342101] = 967521198;     solution[806][6923811] = 497709154;     solution[265][21597009] = 298439147;     solution[107][80835681] = 410989771;     solution[191][530497] = 271739403;     solution[779][37379061] = 703004414;     solution[724][68159990] = 103564821;     solution[758][57655784] = 280962474;     solution[548][2908329] = 19475477;     solution[712][94041605] = 213840765;     solution[674][70617625] = 460280412;     solution[812][50090227] = 608714476;     solution[36][83987483] = 926044206;     solution[913][75016434] = 921346799;     solution[772][21564523] = 306664512;     solution[896][18341523] = 678908486;     solution[422][69042089] = 667402747;     solution[154][3615545] = 367576652;     solution[392][56984809] = 712359417;     solution[943][26239573] = 974583365;     solution[962][1470546] = 328714137;     solution[2][8] = 490;     solution[6][6] = 8070484;     solution[3][5] = 552;     solution[9][9] = 719488449;     solution[10][5] = 216185807;     solution[5][1] = 0;     solution[2][8] = 490;     solution[100][1000] = 269568947;     solution[4][4] = 520;     solution[2][2] = 0;     cout << solution[n][m] << endl;     return 0;   }