malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 5;   const unsigned long long base = 311;   unsigned long long TH[maxn][3], L[3], P[maxn];   int Sol, lona, lonb;   void calc_Hash(string& a, int id) {     int lon = L[id];     for (int i = (1); i <= (lon); i += (1)) {       TH[i][id] = TH[i - 1][id] * base + (unsigned long long)(a[i] -  0 );     }     return;   }   void calc_pot(int N) {     P[0] = 1;     for (int i = (1); i <= (N); i += (1)) {       P[i] = P[i - 1] * base;     }     return;   }   bool completa(int tam, int id) {     int lon = L[id];     unsigned long long H = TH[tam][1];     bool flag = true;     for (int i = (tam); i <= (lon); i += (tam)) {       if (TH[i][id] - TH[i - tam][id] * P[tam] != H) {         flag = false;         break;       }     }     return flag;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     string A, B;     cin >> A >> B;     lona = A.size();     lonb = B.size();     L[1] = lona;     L[2] = lonb;     A =     + A;     B =     + B;     calc_pot(((lona) > (lonb) ? (lona) : (lonb)));     calc_Hash(A, 1);     calc_Hash(B, 2);     int l = ((lona) < (lonb) ? (lona) : (lonb));     for (int i = (1); i <= (l); i += (1)) {       if (!(lona % i) && !(lonb % i)) {         if (completa(i, 1) && completa(i, 2)) {           Sol++;         }       }     }     cout << Sol <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 2e6 + 5;   long long n, k, a[N], res;   void solo() {     cin >> n;     for (int i = 1; i <= n; i++) cout << i + 1 <<    ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long t = 1;     cin >> t;     while (t--) {       solo();       cout << endl;     }     cerr <<   n  << (double)clock() / CLOCKS_PER_SEC * 1000 <<   ms ;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native )   #pragma GCC optimize( unroll-loops )   using namespace std;   vector<string> vec[1003], v;   bool mat[26][26], flag, ok[26], vis[26], run[26];   int ind[26];   inline bool func(int x, int y) {     vector<int> vs, vt;     for (int i = 0; i < v[x].size(); i++) vs.push_back(v[x][i]);     for (int i = 0; i < v[y].size(); i++) vt.push_back(v[y][i]);     reverse(vs.begin(), vs.end());     reverse(vt.begin(), vt.end());     while (!vs.empty() && !vt.empty()) {       if (vt.back() != vs.back())         return mat[vs.back() -  a ][vt.back() -  a ] = 1;       else         vs.pop_back(), vt.pop_back();     }     if (!vs.empty())       return 0;     else       return 1;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     flag = 1;     string str;     int n, k, p;     cin >> n >> k;     for (int i = 0; i < n; i++) {       cin >> p;       for (int j = 0; j < k; j++) {         cin >> str, vec[p].emplace_back(str);         for (int l = 0; l < str.size(); l++) ok[str[l] -  a ] = 1;       }     }     for (int i = 0; i < n; i++)       for (int j = 0; j < k; j++) v.emplace_back(vec[i][j]);     for (int i = 0; i < v.size() - 1 && flag; i++) flag = func(i, i + 1);     for (int i = 0; i < 26; i++)       for (int j = 0; j < 26; j++) ind[j] += mat[i][j];     int cnt = 0, tot = 0;     for (int i = 0; i < 26; i++) tot += ok[i];     queue<int> q;     for (int i = 0; i < 26; i++)       if (ok[i] && !ind[i]) q.push(i);     vector<int> res;     while (!q.empty() && flag) {       int x = q.front();       q.pop();       res.push_back(x);       for (int i = 0; i < 26; i++)         if (mat[x][i]) {           ind[i]--;           if (!ind[i]) q.push(i);         }     }     if (flag && res.size() == tot) {       for (int i = 0; i < res.size(); i++) cout << (char)(res[i] +  a );       cout <<   n ;     } else       cout <<  IMPOSSIBLE n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n1, n2, k1, k2;   long long aa[105][105][2];   long long foo(int u, int v, int a) {     if (u == 0 && v == 0) {       return 1;     }     if (u < 0 || v < 0) {       return 0;     }     if (aa[u][v][a] != -1) return (aa[u][v][a]);     long long s = 0;     if (a) {       for (int i = 1; i <= k1; i++) {         s += foo(u - i, v, !a) % 100000000;       }     } else {       for (int i = 1; i <= k2; i++) {         s += foo(u, v - i, !a) % 100000000;       }     }     aa[u][v][a] = s;     return s;   }   int main() {     cin >> n1 >> n2 >> k1 >> k2;     long long s;     for (int i = 0; i <= 103; i++) {       for (int j = 0; j <= 103; j++) {         aa[i][j][0] = -1;         aa[i][j][1] = -1;       }     }     s = foo(n1, n2, 1);     s += foo(n1, n2, 0);     cout << s % 100000000;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using lint = long long;   using pi = pair<int, int>;   const int MAXN = 1005;   const int MAXM = 1005;   struct edge_color {     int deg[2][MAXN];     pi has[2][MAXN][MAXN];     int color[MAXM];     int c[2];     void clear(int n) {       for (int t = 0; t < 2; t++) {         for (int i = 0; i <= n; i++) {           deg[t][i] = 0;           for (int j = 0; j <= n; j++) {             has[t][i][j] = pi(0, 0);           }         }       }     }     void dfs(int x, int p) {       auto i = has[p][x][c[!p]];       if (has[!p][i.first][c[p]].second)         dfs(i.first, !p);       else         has[!p][i.first][c[!p]] = pi(0, 0);       has[p][x][c[p]] = i;       has[!p][i.first][c[p]] = pi(x, i.second);       color[i.second] = c[p];     }     int solve(vector<pi> v, vector<int> &cv) {       int m = ((int)(v).size());       int ans = 0;       for (int i = 1; i <= m; i++) {         int x[2];         x[0] = v[i - 1].first;         x[1] = v[i - 1].second;         for (int d = 0; d < 2; d++) {           deg[d][x[d]] += 1;           ans = max(ans, deg[d][x[d]]);           for (c[d] = 1; has[d][x[d]][c[d]].second; c[d]++)             ;         }         if (c[0] != c[1]) dfs(x[1], 1);         for (int d = 0; d < 2; d++) has[d][x[d]][c[0]] = pi(x[!d], i);         color[i] = c[0];       }       cv.resize(m);       for (int i = 1; i <= m; i++) {         cv[i - 1] = color[i];         color[i] = 0;       }       return ans;     }   } EC;   int cnt[2][MAXN];   int idx[2][MAXN], L, R;   int main() {     int n, m, t;     scanf( %d %d %d , &n, &m, &t);     for (int i = 0; i < n; i++) scanf( %*d );     vector<pi> ans;     for (int i = 0; i < m; i++) {       int l, r;       scanf( %d %d , &l, &r);       if (cnt[0][l] == 0) idx[0][l] = ++L;       if (cnt[1][r] == 0) idx[1][r] = ++R;       cnt[0][l]++;       cnt[1][r]++;       if (cnt[0][l] == t) cnt[0][l] = 0;       if (cnt[1][r] == t) cnt[1][r] = 0;       ans.emplace_back(idx[0][l], idx[1][r]);     }     vector<int> color;     EC.solve(ans, color);     for (auto &i : color) printf( %d n , i);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string start, end;     cin >> start >> end;     string srev = start;     reverse(srev.begin(), srev.end());     vector<int> vs[26], vr[26];     int slen = start.length();     for (int i = 0; i < slen; i++) {       vs[start[i] -  a ].push_back(i);       vr[srev[i] -  a ].push_back(i);     }     int elen = end.length();     bool flag = true;     for (int i = 0; i < elen; i++) {       if (vs[end[i] -  a ].size() == 0) {         flag = false;         break;       }     }     if (!flag)       cout << -1 << endl;     else {       int no = 0;       vector<pair<int, int> > res;       for (int i = 0; i < elen;) {         int size = vs[end[i] -  a ].size();         pair<int, int> p;         int maxl, ans = 0, index, tmp;         for (int j = 0; j < size; j++) {           index = vs[end[i] -  a ][j];           tmp = index;           maxl = i;           while ((index < slen - 1) && (maxl < elen - 1) &&                  start[index + 1] == end[maxl + 1]) {             index++;             maxl++;           }           if (maxl - i + 1 > ans) {             ans = maxl - i + 1;             p = make_pair(tmp, index);           }         }         maxl = i;         for (int j = 0; j < size; j++) {           index = vr[end[i] -  a ][j];           tmp = index;           maxl = i;           while ((index < slen - 1) && (maxl < elen - 1) &&                  srev[index + 1] == end[maxl + 1]) {             index++;             maxl++;           }           if (maxl - i + 1 > ans) {             ans = maxl - i + 1;             p = make_pair(slen - 1 - tmp, slen - 1 - index);           }         }         i += ans;         no++;         res.push_back(p);       }       cout << no << endl;       for (int i = 0; i < res.size(); i++)         cout << res[i].first + 1 <<     << res[i].second + 1 << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long s, x1, x2, t1, t2, p, d;     cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;     long long ans = abs(x1 - x2) * t2;     long long i = p, t = 0;     while (i != x1) {       i += d;       t += t1;       if (i == s)         d = -1;       else if (i == 0)         d = 1;     }     while (i != x2) {       i += d;       t += t1;       if (i == s)         d = -1;       else if (i == 0)         d = 1;     }     ans = min(ans, t);     cout << ans <<   n ;   }   void solve(bool testcase) {     long long t;     cin >> t;     while (t--) solve();   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mo = (int)1e9 + 7;   const int maxn = 1000010;   int n;   long long fac[maxn], ans;   int a[maxn], num[maxn], num1[maxn], pos[maxn], mul[maxn];   int pre[maxn], ne[maxn];   vector<int> v[maxn];   inline void init() {     fac[0] = 1;     for (int i = 1; i <= n + 2; ++i) fac[i] = fac[i - 1] * i % mo, mul[i] = 1;     for (int i = 2; i <= n; ++i) {       if (!v[i].size()) {         num[n / i]++;         pos[i] = n / i;         for (int j = i; j <= n; j += i) v[j].push_back(i), mul[j] *= i;       }     }     for (int i = 1; i <= n; ++i) num1[mul[i]]++;     num[1]++;     pos[1] = 1;     v[1].push_back(1);   }   int main() {     scanf( %d , &n);     init();     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     for (int i = 1; i <= n; ++i)       if (a[i]) {         num1[mul[a[i]]]--;         if (v[a[i]].size() != v[i].size()) return puts( 0 ), 0;         for (int j = 0; j < v[i].size() - 1; j++)           if (v[a[i]][j] != v[i][j]) return puts( 0 ), 0;         long long x = v[a[i]].back(), y = v[i].back();         if (pos[x] != pos[y]) return puts( 0 ), 0;         if (pre[x] && pre[x] != y) return puts( 0 ), 0;         if (ne[y] && ne[y] != x) return puts( 0 ), 0;         if (!pre[x] && !ne[y]) num[pos[x]]--;         pre[x] = y;         ne[y] = x;       }     ans = 1;     for (int i = 1; i <= n; ++i)       ans = ans * fac[num[i]] % mo, ans = ans * fac[num1[i]] % mo;     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     int tmp;     int ans = 0;     cin >> n;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= i; j++) {         tmp = i * i + j * j;         if (tmp <= n * n && int(sqrt(tmp)) * int(sqrt(tmp)) == tmp) {           ans++;         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};   const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};   const int MAX = 2 * 1000 + 10;   const long long INF = 1e18;   const int MOD = 1e9 + 7;   long long n, m, x, y, a[MAX], b[MAX], c[MAX], d[MAX];   long long dp[MAX][20];   long long sol(long long n, long long ind) {     if (n < 0) return -MOD;     if (ind > m or n == 0) return 0;     if (dp[n][ind] != -1) return dp[n][ind];     long long &ans = dp[n][ind];     ans = y + sol(n - x, ind);     for (long long i = 0; i <= n; i++) {       if (i * c[ind] > n or i * b[ind] > a[ind]) break;       ans = max(ans, i * d[ind] + sol(n - i * c[ind], ind + 1));     }     return ans;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     cin >> n >> m >> x >> y;     for (long long i = 1; i <= m; i++) {       cin >> a[i] >> b[i] >> c[i] >> d[i];     }     memset(dp, -1, sizeof(dp));     cout << sol(n, 0) <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     scanf( %d , &n);     vector<int> A(n);     for (int& a : A) scanf( %d , &a);     sort(A.begin(), A.end());     int m = A[n - 1];     vector<bool> B(m + 2);     for (int a : A) {       if (a > 1 && !B[a - 1])         B[a - 1] = true;       else if (!B[a])         B[a] = true;       else if (!B[a + 1])         B[a + 1] = true;     }     printf( %lu n , count(B.begin(), B.end(), true));   }
#include <bits/stdc++.h>   using namespace std;   long long numbit(long long x) { return (1LL << x) - 1LL; }   long long getbit(long long x, long long i) { return (x >> i) & 1LL; }   long long onbit(long long x, long long i) { return x | (1LL << i); }   long long offbit(long long x, long long i) { return x & (~(1LL << i)); }   const int oo = 1000111000;   const int Nmax = 1e5 + 10;   const long long mod = 1e9 + 7;   const long double PI = 3.14159265358979323846;   int p[Nmax * 2], c[Nmax * 2];   int ch[Nmax * 2];   bool ok[Nmax * 2];   int main() {     ios::sync_with_stdio(0);     cin.tie(NULL);     int test;     cin >> test;     for (long long e = (1); e <= (test); e++) {       int n;       cin >> n;       for (long long i = (1); i <= (n); i++) cin >> p[i];       for (long long i = (1); i <= (n); i++) cin >> c[i];       memset(ok, false, sizeof(ok));       memset(ch, 0, sizeof(ch));       int cnt = 0;       vector<int> circle[n + 1];       for (long long i = (1); i <= (n); i++)         if (!ok[i]) {           cnt++;           int j = i;           while (!ok[j]) {             circle[cnt].push_back(j);             ok[j] = true;             j = p[j];           }         }       int res = n + 1;       for (long long i = (1); i <= (cnt); i++) {         int it = 0;         for (long long m = (1); m <= (circle[i].size()); m++)           if (circle[i].size() % m == 0) {             if (m >= res) break;             int j = 0;             it++;             bool ok = false;             while (j < circle[i].size()) {               if (ch[circle[i][j]] == it) {                 j++;                 continue;               }               ok = true;               int h = j;               while (ok) {                 if (ch[circle[i][h]] == it ||                     c[circle[i][j]] != c[circle[i][h]]) {                   ok = false;                   break;                 }                 ch[circle[i][h]] = it;                 h = (h + m) % circle[i].size();                 if (h == j) break;               }               if (ok) break;               j++;             }             if (ok) {               res = min(res, int(m));               break;             }           }       }       cout << res << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   int p, n, a[100100], b[100100];   bool ok(double t) {     double charging = t * p;     for (int i = 0; i < n; ++i) {       double x = b[i] - a[i] * t;       if (x >= 0)         continue;       else         charging += x;       if (charging < 0) return 0;     }     return 1;   }   int main() {     cin >> n >> p;     for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];     double low = 0, high = 1e11, tol = 1e-7, mid;     while (high - low > tol) {       mid = (high + low) / 2;       if (ok(mid))         low = mid;       else         high = mid;     }     if (low < 9.9e10)       cout << setprecision(10) << fixed << mid;     else       cout << -1;   }
#include <bits/stdc++.h>   using namespace std;   int n, k, a[5001], b[1000001], d[1000001];   void doc() {     for (int i = 1; i <= n; i++) cin >> a[i];   }   void xuli() {     sort(a + 1, a + n + 1);     for (int i = 1; i < n; i++)       for (int j = i + 1; j <= n; j++) d[a[j] - a[i]]++;     int m = 0;     while (true) {       m++;       int dem = 0, res = 0;       for (int j = m; j <= 1000001; j += m) dem += d[j];       if (dem > (k * (k + 1)) / 2) continue;       for (int i = 1; i <= n; i++) {         if (b[a[i] % m] == m) res++;         b[a[i] % m] = m;       }       if (res <= k) break;     }     cout << m;   }   int main() {     cin >> n >> k;     doc();     xuli();   }
#include <bits/stdc++.h>   using namespace std;   int exgcd(int a, int b, int &x, int &y) {     if (b == 0) {       y = 0;       x = 1;       return a;     }     int r = exgcd(b, a % b, x, y);     int tmp = y;     y = x - (a / b) * y;     x = tmp;     return r;   }   int t, n, a[200005], s, ans[200005], k1, k2, len, nos[200005];   set<int> se[200005];   unordered_map<int, int> vis, id;   int main() {     while (~scanf( %d%d , &t, &n)) {       vis.clear();       id.clear();       for (int i = 0; i < 200005; ++i) se[i].clear();       memset(ans, -1, 4 * n + 4);       a[0] = s = 0;       for (int i = 1; i <= n; ++i) {         scanf( %d , &a[i]);         s = (s + a[i]) % t;       }       a[1] = 0;       for (int i = 2; i <= n; ++i) a[i] = (a[i - 1] + a[i]) % t;       int g = exgcd(s, t, k1, k2), cnt = 0, len = t / g;       for (int i = 1; i <= n; ++i) {         if (!vis.count(a[i])) {           vis[a[i]] = true;           if (!id[a[i] % g]) id[a[i] % g] = ++cnt;           nos[i] = 1LL * k1 * (a[i] % g - a[i]) / g % len;           nos[i] = (nos[i] + len) % len;           se[id[a[i] % g]].insert(nos[i]);         } else           ans[i] = 0;       }       for (int i = 1; i <= n; ++i) {         if (ans[i] == -1) {           set<int>::iterator it = se[id[a[i] % g]].find(nos[i]);           if (it == se[id[a[i] % g]].begin())             it = --se[id[a[i] % g]].end();           else             --it;           int s1 = nos[i], s2 = *it, tmp = s1 - s2;           ans[i] = tmp != 0 ? (tmp + len) % len : len;         }       }       for (int i = 1; i <= n; ++i) printf( %d  , ans[i]);       printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:200000000 )   using namespace std;   const int INF = (int)1E9;   const long long INF64 = (long long)1E18;   const double EPS = 1E-9;   const double PI = acos((double)0) * 2;   const int MAXN = 210000;   struct pt {     int x, y, id;     bool operator<(const pt& p) const {       return make_pair(x, y) < make_pair(p.x, p.y);     }   };   int n, k;   pt a[MAXN], b[MAXN];   bool read() {     if (!(cin >> n >> k)) return false;     for (int i = 0; i < int(n); ++i) {       scanf( %d%d , &a[i].x, &a[i].y);       a[i].id = i;     }     return true;   }   int killed[MAXN], cu;   inline void skip(pt p[], int& ptr) {     while (ptr < n && killed[p[ptr].id] == cu) ++ptr;   }   bool check(pt delta) {     ++cu;     int already = 0;     int pa = 0, pb = 0;     for (;;) {       skip(a, pa);       skip(b, pb);       if (pa == n && pb == n) break;       if (pa == n) {         ++pb;         if (++already > k) return false;         continue;       }       if (pb == n) {         ++pa;         if (++already > k) return false;         continue;       }       pt tmp = b[pb];       tmp.x += delta.x;       tmp.y += delta.y;       if (tmp.x == a[pa].x && tmp.y == a[pa].y) {         ++pa;         ++pb;         continue;       }       if (++already > k) return false;       if (tmp < a[pa]) {         killed[b[pb].id] = cu;         ++pb;       } else {         killed[a[pa].id] = cu;         ++pa;       }     }     return already <= k;   }   void solve() {     if (k >= n) {       puts( -1 );       return;     }     for (int i = 0; i < int(n); ++i) {       b[i] = a[i];       b[i].x *= -1;       b[i].y *= -1;     }     sort(a, a + n);     sort(b, b + n);     set<pt> ans;     for (int c1 = 0; c1 < int(min(n, k + 13)); ++c1)       for (int c2 = 0; c2 < int(min(n, k + 13)); ++c2) {         pt delta;         delta.x = a[c2].x - b[c1].x;         delta.y = a[c2].y - b[c1].y;         if (!ans.count(delta))           if (check(delta)) ans.insert(delta);       }     printf( %d n , ans.size());     for (set<pt>::iterator i = ans.begin(); i != ans.end(); ++i) {       pt p = *i;       printf( %.1lf %.1lf n , p.x / 2.0, p.y / 2.0);     }   }   int main() {     if (!read()) throw;     solve();   }
#include <bits/stdc++.h>   using namespace std;   struct matrix {     int a[25][25];   };   struct matrix g, b, e;   int l, r, mod = 1000000007;   int ans;   void init() {     int i, j;     g.a[7][2] = 1;     g.a[10][3] = 1;     g.a[11][3] = 1;     g.a[8][5] = 1;     g.a[10][6] = 1;     g.a[11][6] = 1;     g.a[2][7] = 1;     g.a[3][7] = 1;     g.a[5][8] = 1;     g.a[6][8] = 1;     g.a[2][10] = 1;     g.a[3][10] = 1;     g.a[5][11] = 1;     g.a[6][11] = 1;     for (i = 1; i <= 12; i++)       for (j = 13; j <= 24; j++) g.a[i][j] = g.a[i][j - 12];     for (i = 13; i <= 24; i++) g.a[i][i] = 1;     b.a[1][2] = 1;     b.a[1][3] = 1;     b.a[1][5] = 1;     b.a[1][6] = 1;     b.a[1][7] = 1;     b.a[1][8] = 1;     b.a[1][10] = 1;     b.a[1][11] = 1;     b.a[1][14] = 1;     b.a[1][15] = 1;     b.a[1][17] = 1;     b.a[1][18] = 1;     b.a[1][19] = 1;     b.a[1][20] = 1;     b.a[1][22] = 1;     b.a[1][23] = 1;     for (i = 1; i <= 24; i++) e.a[i][i] = 1;   }   matrix operator*(matrix aa, matrix bb) {     int i, j, k;     matrix ret;     for (i = 1; i <= 24; i++)       for (j = 1; j <= 24; j++) ret.a[i][j] = 0;     for (i = 1; i <= 24; i++)       for (k = 1; k <= 24; k++)         if (aa.a[i][k]) {           for (j = 1; j <= 24; j++)             ret.a[i][j] =                 (ret.a[i][j] + (long long)aa.a[i][k] * bb.a[k][j] % mod) % mod;         }     return ret;   }   matrix fpow(int j) {     matrix d, ret;     ret = e;     d = g;     while (j != 0) {       if (j & 1) ret = ret * d;       d = d * d;       j = j / 2;     }     return ret;   }   int calc(int n) {     matrix s;     int i, ret = 0;     if (n == 0) return 0;     if (n == 1) return 4;     s = b * fpow(n - 2);     for (i = 13; i <= 24; i++) ret = (ret + s.a[1][i]) % mod;     return ret + 4;   }   int main() {     int i, j;     init();     scanf( %d%d , &l, &r);     ans = (((long long)calc(r) + calc((r + 1) / 2)) % mod -            ((long long)calc(l - 1) + calc(l / 2)) % mod) %           mod;     if (ans % 2 != 0) ans += mod;     ans /= 2;     ans = (ans + mod) % mod;     cout << ans << endl;     return 0;   }