malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   vector<pair<pair<int, int>, int> > g[100010];   long long dist[100010];   bool mark[100010];   int req[100010];   void dijkstra(int n) {     memset(mark, 0, sizeof(mark));     priority_queue<pair<long long, long long>,                    vector<pair<long long, long long> >,                    greater<pair<long long, long long> > >         pq;     pq.push(make_pair(dist[n], n));     while (!pq.empty()) {       int u = pq.top().second;       pq.pop();       if (mark[u]) continue;       mark[u] = true;       for (int i = 0; i < g[u].size(); i++) {         pair<int, int> v = g[u][i].first;         int t = g[u][i].second;         if (dist[v.first] > dist[u] + v.second) {           dist[v.first] = dist[u] + v.second;           pq.push(make_pair(dist[v.first], v.first));           req[v.first] = t;         } else if (t == -1 && dist[v.first] == dist[u] + v.second) {           dist[v.first] = dist[u] + v.second;           req[v.first] = t;         }       }     }   }   int main(int argc, char const *argv[]) {     for (int i = 0; i < 100010; i++) dist[i] = 1LL << 60;     int n, m, k;     scanf( %d%d%d , &n, &m, &k);     while (m--) {       int x, y, z;       scanf( %d%d%d , &x, &y, &z);       g[x].push_back({{y, z}, -1});       g[y].push_back({{x, z}, -1});     }     dist[1] = 0;     dijkstra(1);     int ans = 0;     for (int i = 0; i < k; i++) {       int x, y;       scanf( %d%d , &x, &y);       g[1].push_back({{x, y}, i + 1});       g[x].push_back({{1, y}, i + 1});     }     dijkstra(1);     for (int i = 1; i <= n; i++) {       if (req[i] > 0) ans++;     }     ans = k - ans;     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 987654321;   double f[107][107][107];   int main() {     ios::sync_with_stdio(false);     cout.precision(10);     cout << fixed;     int R, S, P;     cin >> R >> S >> P;     memset(f, 0, sizeof(f));     f[R][S][P] = 1.0;     for (int r = R; r >= 0; --r) {       for (int s = S; s >= 0; --s) {         for (int p = P; p >= 0; --p) {           int n = r + s + p;           if (n < 2) continue;           double x =               1.0 * (r * (r - 1) + s * (s - 1) + p * (p - 1)) / n / (n - 1);           if (r && p)             f[r - 1][s][p] +=                 f[r][s][p] * (2 * r * p) / (n * (n - 1)) / (1.0 - x);           if (r && s)             f[r][s - 1][p] +=                 f[r][s][p] * (2 * r * s) / (n * (n - 1)) / (1.0 - x);           if (s && p)             f[r][s][p - 1] +=                 f[r][s][p] * (2 * s * p) / (n * (n - 1)) / (1.0 - x);         }       }     }     double res[3];     memset(res, 0, sizeof(res));     for (int r = 1; r <= R; ++r) res[0] += f[r][0][0];     for (int s = 1; s <= S; ++s) res[1] += f[0][s][0];     for (int p = 1; p <= P; ++p) res[2] += f[0][0][p];     cout << res[0] <<     << res[1] <<     << res[2] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int c1, c2, c3, c4;   int a[1111], b[1111];   int n, m;   int main() {     while (cin >> c1 >> c2 >> c3 >> c4) {       cin >> n >> m;       for (int i = 0; i < n; i++) cin >> a[i];       for (int i = 0; i < m; i++) cin >> b[i];       int mi = min(c4, 2 * c3);       int nm = c3;       for (int i = 0; i < n; i++) nm += min(c1 * a[i], c2);       mi = min(mi, nm);       nm = c3;       for (int i = 0; i < m; i++) nm += min(c1 * b[i], c2);       mi = min(mi, nm);       nm = 0;       for (int i = 0; i < n; i++) nm += min(c1 * a[i], c2);       for (int i = 0; i < m; i++) nm += min(c1 * b[i], c2);       mi = min(mi, nm);       cout << mi << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int t;     cin >> t;     while (t--) {       long long int n, k1, k2, m1 = INT_MIN, m2 = INT_MIN, tmp;       cin >> n >> k1 >> k2;       for (long long int i = 0; i < k1; i++) {         cin >> tmp;         m1 = max(m1, tmp);       }       for (long long int i = 0; i < k2; i++) {         cin >> tmp;         m2 = max(m2, tmp);       }       if (m1 > m2) {         cout <<  YES  << endl;       } else         cout <<  NO  << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   long long mod = 1000000007;   long long power(long long x, int y) {     long long res = 1;     x = x % mod;     if (x == 0) return 0;     while (y > 0) {       if (y & 1) res = (res * x) % mod;       y = y >> 1;       x = (x * x) % mod;     }     return res;   }   int modInverse(long long a) { return power(a, mod - 2); }   long long factmod(long long a) {     long long val = 1;     while (a > 0) {       val = (val * a) % mod;       a--;     }     return val;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long n, m, ans;     cin >> n >> m;     ans = (factmod(n + 2 * m - 1) * modInverse(factmod(2 * m)) % mod *            modInverse(factmod(n - 1) % mod)) %           mod;     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   void err(istream_iterator<string> it) { cout << endl; }   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr << *it <<   =   << a <<    ;     err(++it, args...);   }   template <typename T>   inline void read(T& x) {     x = 0;     T f = 1;     char ch = getchar();     while (!isdigit(ch)) f = (ch ==  - ) ? -1 : 1, ch = getchar();     while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();     x *= f;   }   template <typename T, typename... Args>   inline void read(T& x, Args&... args) {     read(x), read(args...);   }   constexpr int MAXN = 1e5 + 5, MOD = 1e9 + 7;   int n, cnt;   array<int, MAXN> a;   array<vector<pair<int, int>>, MAXN> p;   vector<int> id[4];   int main() {     ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);     ;     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     int high = n + 1;     for (int i = n; i >= 1; i--) {       if (a[i] == 0)         continue;       else if (a[i] == 1) {         if (high < 1) return cout << -1 <<   n , 0;         p[i].emplace_back(i, --high), id[1].push_back(i), cnt++;       } else if (a[i] == 2) {         if (id[1].size() == 0) return cout << -1 <<   n , 0;         int tmp = id[1].back();         id[1].pop_back();         p[i].emplace_back(i, p[tmp][0].second);         id[2].push_back(i), cnt++;       } else {         if (id[3].size()) {           int tmp = id[3].back();           id[3].pop_back();           if (high < 1) return cout << -1 <<   n , 0;           p[i].emplace_back(i, --high);           p[i].emplace_back(p[tmp][0].first, high);         } else if (id[2].size()) {           int tmp = id[2].back();           id[2].pop_back();           if (high < 1) return cout << -1 <<   n , 0;           p[i].emplace_back(i, --high);           p[i].emplace_back(p[tmp][0].first, high);         } else if (id[1].size()) {           int tmp = id[1].back();           id[1].pop_back();           if (high < 1) return cout << -1 <<   n , 0;           p[i].emplace_back(i, --high);           p[i].emplace_back(p[tmp][0].first, high);         } else           return cout << -1 <<   n , 0;         id[3].push_back(i);         cnt += 2;       }     }     cout << cnt <<   n ;     for (int i = n; i >= 1; i--)       for (auto& j : p[i]) cout << j.second <<     << j.first <<   n ;     return 0;   }
#include <bits/stdc++.h>   const long long MOD = 1e9 + 7;   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long n;     cin >> n;     while (n--) {       long long ci, sum;       cin >> ci >> sum;       long long n = sum / ci;       long long rem = sum % ci;       long long ans = rem * (pow(n + 1, 2));       ci -= rem;       ans += ci * (pow(n, 2));       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct data {     int id, a;     data() {}     data(int id, int a) : id(id), a(a) {}     bool operator<(const data &r) const { return a < r.a; }   } da[100010];   int n, h;   int main() {     scanf( %d%d , &n, &h);     for (int i = 0; i < n; i++) scanf( %d , &da[i].a), da[i].id = i;     if (n == 2) {       printf( 0 n );       for (int i = 0; i < n; i++) printf( 1  );       puts(  );       return 0;     }     sort(da, da + n);     int f1 = da[n - 1].a + da[n - 2].a - da[0].a - da[1].a;     int f2 = max(da[n - 1].a + da[0].a + h, da[n - 1].a + da[n - 2].a) -              min(da[0].a + da[1].a + h, da[1].a + da[2].a);     if (f1 <= f2) {       printf( %d n , f1);       for (int i = 0; i < n; i++) printf( 1  );       puts(  );     } else {       printf( %d n , f2);       for (int i = 0; i < n; i++)         if (da[0].id == i)           printf( 1  );         else           printf( 2  );       puts(  );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1605;   int n, m, tot;   int a[MAXN][MAXN];   int sz[MAXN * MAXN];   int ans[MAXN * MAXN];   int cnt[MAXN * MAXN];   int fa1[MAXN * MAXN];   int fa2[MAXN * MAXN];   double v[MAXN][MAXN];   double t[MAXN][MAXN];   int getroot(int *fa, int u) {     return u == fa[u] ? u : fa[u] = getroot(fa, fa[u]);   }   void run() {     memcpy(t, v, sizeof(t));     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j]) {           double sum = 0, cnt = 0;           for (int k = i - 4; k <= i + 4; k++)             for (int l = j - 4; l <= j + 4; l++)               if (k >= 1 && k <= n && l >= 1 && l <= m &&                   (i - k) * (i - k) + (j - l) * (j - l) <= 25)                 sum += t[k][l], cnt++;           v[i][j] = sum / cnt;         }   }   void merge(int *fa, int xa, int ya, int xb, int yb) {     if (!a[xa][ya] || !a[xb][yb]) return;     fa[getroot(fa, (xa - 1) * m + ya)] = getroot(fa, (xb - 1) * m + yb);   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         fa1[(i - 1) * m + j] = fa2[(i - 1) * m + j] = (i - 1) * m + j;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++) scanf( %d , &a[i][j]);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j]) {           v[i][j] = 1;           if (i > 1) merge(fa1, i, j, i - 1, j);           if (i < n) merge(fa1, i, j, i + 1, j);           if (j > 1) merge(fa1, i, j, i, j - 1);           if (j < m) merge(fa1, i, j, i, j + 1);         }     run();     run();     run();     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j] && v[i][j] < 0.2) {           if (i > 1 && v[i - 1][j] < 0.2) merge(fa2, i, j, i - 1, j);           if (i < n && v[i + 1][j] < 0.2) merge(fa2, i, j, i + 1, j);           if (j > 1 && v[i][j - 1] < 0.2) merge(fa2, i, j, i, j - 1);           if (j < m && v[i][j + 1] < 0.2) merge(fa2, i, j, i, j + 1);         }     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j] && v[i][j] < 0.2) sz[getroot(fa2, (i - 1) * m + j)]++;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j] && v[i][j] < 0.2 &&             getroot(fa2, (i - 1) * m + j) == (i - 1) * m + j &&             sz[(i - 1) * m + j] >= 5)           cnt[getroot(fa1, (i - 1) * m + j)]++;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (a[i][j] && getroot(fa1, (i - 1) * m + j) == (i - 1) * m + j)           ans[++tot] = cnt[(i - 1) * m + j];     sort(ans + 1, ans + tot + 1);     printf( %d n , tot);     for (int i = 1; i <= tot; i++) printf( %d  , ans[i]);     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, x;     cin >> n;     x = (n + 1) / 2;     string s, even, odd;     cin >> s;     for (int i = 0; i < n; i++) {       if (i % 2 == 0)         odd.push_back(s[i]);       else         even.push_back(s[i]);     }     if (n <= 2) {       cout << s << endl;     } else {       if (n % 2 == 0) {         reverse(odd.begin(), odd.end());         for (int i = 0; i < x; i++) {           odd.push_back(even[i]);         }         even = odd;       } else if (n % 2 == 1) {         reverse(even.begin(), even.end());         for (int i = 0; i < x; i++) {           even.push_back(odd[i]);         }       }       cout << even << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long modl = 1000000007;   int farr[1000000];   int pre[1000000];   int cum[1000000];   unsigned long long poow(int base, int po);   void swaap(int *a, int *b);   long long gcd(long long a, long long b);   void mul_big_int(string s1, string s2);   int cnt_prime(int n);   int main() {     cin.tie(0);     cin.sync_with_stdio(0);     int n, l, r, cntr = 0, sum = 0, num = 0;     long long x;     int maxi = INT_MIN, mini = INT_MAX;     cin >> n >> l >> r >> x;     int arr[n];     for (int i = 0; i < n; i++) cin >> arr[i];     for (int i = 0; i < (1 << n); i++) {       for (int j = 0; j < n; j++) {         int r;         r = i & (1 << j);         if (r) {           cntr++;           sum += arr[j];           maxi = max(maxi, arr[j]);           mini = min(mini, arr[j]);         }       }       if (cntr >= 2) {         if (sum >= l && sum <= r) {           if (maxi - mini >= x) num++;         }       }       cntr = 0;       maxi = INT_MIN;       mini = INT_MAX;       sum = 0;     }     cout << num <<   n ;     return 0;   }   unsigned long long poow(int base, int po) {     if (po == 0) return 1;     if (po == 1) return base;     unsigned long long ans = poow(base, po / 2);     ans = (ans * ans);     if (po & 1) return (ans * base);     return ans;   }   void swaap(int *a, int *b) {     int temp;     temp = *a;     *a = *b;     *b = temp;   }   long long gcd(long long a, long long b) {     if (b == 0) return a;     return gcd(b, a % b);   }   void mul_big_int(string s1, string s2) {     reverse(s1.begin(), s1.end());     reverse(s2.begin(), s2.end());     int mul[1000];     memset(mul, 0, sizeof(mul));     long long ln1 = s1.length(), ln2 = s2.length();     for (int i = 0; i < ln1; i++) {       for (int j = 0; j < ln2; j++) {         mul[i + j] += ((s1[i] -  0 ) * (s2[j] -  0 ));       }     }     for (int i = 0; i < 1000; i++) {       mul[i + 1] += mul[i] / 10;       mul[i] %= 10;     }     int i = 999;     while (i > 0 && mul[i] == 0) i--;     for (; i >= 0; i--) {       cout << mul[i];     }     cout << endl;   }   int cnt_prime(int n) {     vector<bool> prime(n + 1, true);     prime[0] = false;     prime[1] = false;     for (long long i = 2; i * i <= n; i++) {       if (prime[i]) {         for (int j = i * i; j <= n; j += i) prime[j] = 0;       }     }     int cntr = 0;     for (int i = 0; i < (int)prime.size(); i++) {       if (prime[i]) cntr++;     }     return cntr;   }
#include <bits/stdc++.h>   const long long int INF = 1e15;   using namespace std;   const long long int MAX = 1e7 + 5;   const long long int mod = 1e9 + 7;   long long int gcd(long long int a, long long int b) {     while (b > 0) {       a = a % b;       swap(a, b);     }     return a;   }   long long int binpow(long long int a, long long int b) {     long long int res = 1;     while (b > 0) {       if (b % 2 == 1) res = res * a % mod;       a = a * a % mod;       b /= 2;     }     return res % mod;   }   void solve() {     long long int n;     cin >> n;     long long int ans = 3 * n * n - 2 + 3 * (n - 1) * (n - 1);     cout << ans <<   n ;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int t = 1;     for (long long int i = 1; i <= t; i++) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 81;   const int M = 2001;   int n, k, m, ans = 1e9;   int cache[N][2][N][N];   vector<pair<int, int> > g[N];   int dp(int idx, int dir, int dist, int taken) {     if (taken == k) return 0;     int &ans = cache[idx][dir][dist][taken];     if (ans != -1) return ans;     ans = 1e9;     for (auto &it : g[idx]) {       if (abs(it.first - idx) <= dist) {         if ((it.first - idx > 0 && dir > 0) || (idx - it.first > 0 && dir == 0)) {           ans = min(               ans,               it.second +                   min(dp(it.first, dir, dist - abs(it.first - idx), taken + 1),                       dp(it.first, dir ^ 1, abs(it.first - idx) - 1, taken + 1)));         }       }     }     return ans;   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     memset(cache, -1, sizeof(cache));     cin >> n >> k >> m;     for (int i = 1; i <= m; i++) {       int u, v, c;       cin >> u >> v >> c;       g[u].push_back({v, c});     }     for (int i = 1; i <= n; i++)       ans = min(ans, min(dp(i, 1, n - i, 1), dp(i, 0, i - 1, 1)));     if (ans > 1e8) ans = -1;     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   bool next_n(vector<int> &a) {     int i = n - 1;     for (; i >= 0 && a[i] == 5; --i) {       a[i] = 0;     }     if (i == -1) {       return false;     }     ++a[i];     return true;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int m;     cin >> n >> m;     vector<vector<int>> graph(n);     int from, to;     for (int i = 0; i < m; ++i) {       cin >> from >> to;       --from;       --to;       graph[from].push_back(to);       graph[to].push_back(from);     }     vector<int> ns(n);     int answ = 0;     do {       set<pair<int, int>> ps;       for (int i = 0; i < n; ++i) {         for (int j : graph[i]) {           int a = ns[i];           int b = ns[j];           if (a > b) {             swap(a, b);           }           ps.emplace(a, b);         }       }       answ = max(answ, (int)ps.size());     } while (next_n(ns));     cout << answ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main(int argc, char const *argv[]) {     string input;     cin >> input;     int i = 0;     if (input[0] ==  9 ) ++i;     for (; i < input.length(); ++i) {       if (input[i] >=  5 ) {         input[i] =  0  +  9  - input[i];       }     }     for (int j = 0; j < input.length(); ++j) {       cout << input[j];     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char arr[21];   char brr[21];   int player1[100];   int player2[100];   int main() {     char z;     cin >> arr;     cin >> brr;     memset(player1, 0, sizeof(player1));     memset(player2, 0, sizeof(player2));     int n, t, d, i, f, m;     char p, s;     cin >> n;     for (i = 0; i < n; i++) {       cin >> t >> p >> d >> s;       if (p ==  a ) {         if (player1[d] == 0 && s ==  y ) {           f = t;           player1[d]++;         } else if (s =  r  && player1[d] < 2) {           cout << brr <<     << d <<     << t <<   n ;           player1[d] = 5;         } else if (player1[d] == 1 && s ==  y ) {           if (t < f) t = f;           cout << brr <<     << d <<     << t <<   n ;           player1[d] = 5;         }       } else {         if (player2[d] == 0 && s ==  y ) {           m = t;           player2[d]++;         } else if (s =  r  && player2[d] < 2) {           cout << arr <<     << d <<     << t <<   n ;           player2[d] = 5;         } else if (player2[d] == 1 && s ==  y ) {           if (m > t) t = m;           cout << arr <<     << d <<     << t <<   n ;           player2[d] = 5;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T, class S>   ostream& operator<<(ostream& os, const pair<T, S>& v) {     return os <<  (  << v.first <<  ,   << v.second <<  ) ;   }   template <class T>   ostream& operator<<(ostream& os, const vector<T>& v) {     os <<  [ ;     for (int i = int(0); i <= int((static_cast<int>((v).size())) - 1); ++i) {       if (i) os <<  ,  ;       os << v[i];     }     return os <<  ] ;   }   template <class T>   bool setmax(T& _a, T _b) {     if (_a < _b) {       _a = _b;       return true;     }     return false;   }   template <class T>   bool setmin(T& _a, T _b) {     if (_b < _a) {       _a = _b;       return true;     }     return false;   }   template <class T>   T gcd(T _a, T _b) {     return _b == 0 ? _a : gcd(_b, _a % _b);   }   int main() {     int n, k;     cin >> n >> k;     if (n <= 3 || (n == 4 && k == 2) || (k != 2 && k != 3)) {       printf( -1 n );     } else {       if (k == 2) {         printf( %d n , 3 + (n - 4) * 2);         printf( 1 2 n );         printf( 2 3 n );         printf( 3 4 n );         for (int i = int(5); i <= int(n); ++i) {           printf( %d 1 n , i);           printf( %d 4 n , i);         }       } else {         printf( %d n , 1 + (n - 3) * 2);         printf( 1 2 n );         for (int i = int(4); i <= int(n); ++i) {           printf( %d 2 n , i);           printf( %d 3 n , i);         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[100000];   char t[1000];   int main() {     string s, sa;     stack<int> sta;     int i, j;     while (cin >> sa) {       s += sa;     }     int cnt = 0;     for (i = 0; i < s.length(); i++) {       if (s[i] !=  < ) continue;       i++;       for (j = 0; i < s.length() && s[i] !=  > ; i++, j++) {         t[j] = s[i];       }       t[j] =   0 ;       if (strcmp(t,  table ) == 0) {         sta.push(0);       } else if (strcmp(t,  /table ) == 0) {         a[cnt++] = sta.top();         sta.pop();       } else if (strcmp(t,  /td ) == 0) {         sta.top()++;       }     }     sort(a, a + cnt);     for (i = 0; i < cnt - 1; i++) cout << a[i] <<    ;     cout << a[i] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline T sqr(const T& a) {     return a * a;   }   template <typename T>   inline int sign(const T& a) {     return a < 0 ? -1 : a > 0;   }   void task();   int main() {     ios_base::sync_with_stdio(0);     task();     return 0;   }   int h, q;   long long int l, r;   vector<pair<long long, long long> > bad;   vector<pair<long long, long long> > ok;   void task() {     cin >> h >> q;     long long int start = 1;     for (int i = 1; i < h; ++i) start *= 2;     l = start;     r = start * 2 - 1;     while (q--) {       long long int i;       long long int _l, _r, ans;       cin >> i >> _l >> _r >> ans;       while (_l < start) _l *= 2;       while (_r < start) _r *= 2, ++_r;       if (ans) {         if (_l > r || _r < l) {           cout <<  Game cheated! ;           return;         }         l = max(l, _l);         r = min(r, _r);         ok.push_back(pair<long long, long long>{_l, _r});       } else {         bad.push_back(pair<long long, long long>{_l, _r});       }     }     bad.push_back(pair<long long, long long>{-2, -2});     bad.push_back(pair<long long, long long>{4 * start, 4 * start});     sort((bad.begin()), (bad.end()));     vector<pair<long long, long long> > v;     pair<long long, long long> cur = bad[0];     for (int i = 1; i < (int)bad.size(); ++i) {       pair<long long, long long> x = bad[i];       if (x.first <= cur.second + 1) {         cur.second = max(cur.second, x.second);       } else {         v.push_back(cur);         cur = x;       }     }     v.push_back(cur);     bad = v;     vector<pair<long long, long long> > well;     long long int sum = 0;     for (int i = 1; i < bad.size(); ++i) {       long long int ll = max(bad[i - 1].second, l - 1);       long long int rr = min(r + 1, bad[i].first);       long long int len = rr - ll - 1;       if (len > 0) {         well.push_back(pair<long long, long long>{ll + 1, rr - 1});         sum += len;       }     }     if (sum == 0) {       cout <<  Game cheated! ;     } else if (sum == 1) {       assert(well.front().first == well.front().second);       assert(well.size() == 1);       cout << well.front().first;     } else {       cout <<  Data not sufficient! ;     }   }