malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   void __print(int x) {cerr << x;}   void __print(long x) {cerr << x;}   void __print(long long x) {cerr << x;}   void __print(unsigned x) {cerr << x;}   void __print(unsigned long x) {cerr << x;}   void __print(unsigned long long x) {cerr << x;}   void __print(float x) {cerr << x;}   void __print(double x) {cerr << x;}   void __print(long double x) {cerr << x;}   void __print(char x) {cerr <<      << x <<     ;}   void __print(const char *x) {cerr <<     << x <<    ;}   void __print(const string &x) {cerr <<     << x <<    ;}   void __print(bool x) {cerr << (x ?  true  :  false );}      template<typename T, typename V>   void __print(const pair<T, V> &x) {cerr <<  { ; __print(x.first); cerr <<  , ; __print(x.second); cerr <<  } ;}   template<typename T>   void __print(const T &x) {int f = 0; cerr <<  { ; for (auto &i: x) cerr << (f++ ?  ,  :   ), __print(i); cerr <<  } ;}   void _print() {cerr <<  ] n ;}   template <typename T, typename... V>   void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr <<  ,  ; _print(v...);}   #ifndef ONLINE_JUDGE   #define debug(x...) cerr <<  [  << #x <<  ] = [ ; _print(x)   #else   #define debug(x...)   #endif      #define ll long long int   const int mod = 1000000007;   int mpow(int b, int e);      void solve(){    int n; cin>>n;     vector<int> even, odd;     for(int i=0; i<n;i++){     int x; cin>>x;      if(x&1) odd.push_back(x);      else even.push_back(x);     }       for(auto i:odd) cout<<i<<   ;     for(auto i:even) cout<<i<<   ;     cout<<endl;      }      int main(){       ios_base::sync_with_stdio(false);       cin.tie(0);cout.tie(0);       int t=1;       cin>>t;       for(int tt=1; tt<=t; tt++){           //cout <<  Case # <<tt<< :  ;           solve();       }       return 0;   }      //modular exponentiation   int mpow(int base, int exp) {     base %= mod;     int result = 1;     while (exp > 0) {       if (exp & 1) result = ((ll)result * base) % mod;       base = ((ll)base * base) % mod;       exp >>= 1;     }     return result;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k;   long long calc(long long n, long long k) {     map<long long, long long> l, r;     l.clear();     r.clear();     long long cnt[2];     cnt[0] = cnt[1] = 0;     if (k == 1) return n / 2;     k--;     l[n / 2] = 1;     r[n / 2 + (n % 2)] = 1;     while (1) {       if ((*l.rbegin()).first / 2 >= (*r.rbegin()).first / 2) {         if ((*l.rbegin()).second >= k) return calc(n / 2, k + cnt[0]);         k -= (*l.rbegin()).second;         cnt[0] += (*l.rbegin()).second;         l[(*l.rbegin()).first / 2] += (*l.rbegin()).second;         l[(*l.rbegin()).first / 2 + ((*l.rbegin()).first % 2)] +=             (*l.rbegin()).second;         l.erase((*l.rbegin()).first);       } else {         if ((*r.rbegin()).second >= k)           return calc(n / 2 + (n % 2), k + cnt[1]) + n / 2;         k -= (*r.rbegin()).second;         cnt[1] += (*r.rbegin()).second;         r[(*r.rbegin()).first / 2] += (*r.rbegin()).second;         r[(*r.rbegin()).first / 2 + ((*r.rbegin()).first % 2)] +=             (*r.rbegin()).second;         r.erase((*r.rbegin()).first);       }     }   }   int main() {     cin >> n >> k;     if (k == 1) {       cout << 1;       return 0;     }     if (k == 2) {       cout << n;       return 0;     }     cout << 1 + calc(n - 1, k - 2);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int ed;   int l[360360 + 1], qd[8405400 + 1], qn[8405400 + 1];   int q[360360 + 1];   void bd(int first, int second) {     qd[++ed] = second;     qn[ed] = l[first];     l[first] = ed;   }   inline void bfs(int st, long long v[]) {     for (int i = (0); i < (360360 + 1); ++i) v[i] = -1;     v[st] = 0;     q[0] = st;     for (int i = 0, j = 0; i <= j; i++) {       for (int k = (l[q[i]]); k; k = qn[k])         if (v[qd[k]] == -1) {           v[qd[k]] = v[q[i]] + 1;           q[++j] = qd[k];         }     }   }   int main(int argc, char **argv) {     long long A, B, K;     cin >> A >> B >> K;     for (int i = (0); i < (360360 + 1); ++i) {       if (i) bd(i, i - 1);       for (int j = (2); j < (K + 1); ++j) bd(i, i - (i % j));     }     long long s[360360 + 1], t[360360 + 1];     bfs(A % 360360, s);     bfs(360360, t);     if (A / 360360 == B / 360360)       cout << s[B % 360360];     else       cout << (s[0] + t[0] * (A / 360360 - B / 360360 - 1) + t[B % 360360]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int const N = 250000, B = 18;   vector<int> tr1[N + 1], tr2[N + 1];   int n, dp[N + 1], pa[N + 1][B], gr[N + 1];   int P(int v) { return gr[v] ? gr[v] = P(gr[v]) : v; }   void pl(int v = 1, int p = 0) {     dp[v] = dp[p] + 1;     pa[v][0] = p;     int k = 1, z;     while (k < B && (z = pa[v][k - 1])) pa[v][k] = pa[z][k - 1], ++k;     for (int u : tr1[v])       if (u != p) pl(u, v);   }   int lca(int a, int b) {     if (dp[a] < dp[b]) swap(a, b);     int d = dp[a] - dp[b], j = 0;     while (d) {       if (d & 1) a = pa[a][j];       ++j;       d >>= 1;     }     if (a == b) return a;     for (int i = B - 1; i >= 0; --i)       if (pa[a][i] != pa[b][i]) a = pa[a][i], b = pa[b][i];     return pa[a][0];   }   void J(int a, int b) {     printf( %d %d , a, b);     gr[a] = b;   }   void kl(int a, int b) {     a = P(a);     int c = lca(a, b);     if (c != a)       J(a, pa[a][0]);     else {       for (int i = B - 1; i >= 0; --i)         if (dp[pa[b][i]] > dp[c] && P(pa[b][i]) != a) b = pa[b][i];       J(b, pa[b][0]);     }   }   void go(int v = 1, int p = 0) {     for (int u : tr2[v])       if (u != p) go(u, v);     if (p) {       kl(v, p);       printf(  %d %d n , v, p);     }   }   int main() {     scanf( %d , &n);     for (int i = 1; i < (int)(n); ++i) {       int a, b;       scanf( %d%d , &a, &b);       tr1[a].push_back(b);       tr1[b].push_back(a);     }     for (int i = 1; i < (int)(n); ++i) {       int a, b;       scanf( %d%d , &a, &b);       tr2[a].push_back(b);       tr2[b].push_back(a);     }     pl();     printf( %d n , n - 1);     go();   }
#include <bits/stdc++.h>   using namespace std;   deque<int> enumeration;   deque<int> cutOrder;   struct Edge {     Edge(int from, int to, int ind) : from(from), to(to), ind(ind) {}     int from, to, ind;     shared_ptr<Edge> nxt = nullptr;     shared_ptr<Edge> rev = nullptr;     shared_ptr<Edge> flip = nullptr;   };   void search(shared_ptr<Edge> e, int end) {     if (e->flip == nullptr) {       enumeration.push_back(e->from);       if (e->to != end) {         search(e->nxt, end);       }     } else {       search(e->flip->rev->nxt, e->to);       if (e->to != end) {         search(e->nxt, end);       }     }     if (e->to == end) {       cutOrder.push_back(e->ind);     }   }   auto hashf = [](pair<int, int> p) { return p.first + (p.second << 15); };   unordered_map<pair<int, int>, shared_ptr<Edge>, decltype(hashf)> edgeSet(1000,                                                                            hashf);   shared_ptr<Edge> addFlip(shared_ptr<Edge> e) {     pair<int, int> p(e->from, e->to);     shared_ptr<Edge> flip = edgeSet[p];     if (flip == nullptr) {       edgeSet[p] = e;     } else {       assert(flip->flip == nullptr);       e->flip = flip;       flip->flip = e;     }     return e;   }   void addTriangle(int a, int b, int c, int i) {     shared_ptr<Edge> e1, e2, e3, e1r, e2r, e3r;     e1 = make_shared<Edge>(a, b, i);     e2 = make_shared<Edge>(b, c, i);     e3 = make_shared<Edge>(c, a, i);     e1->nxt = e2;     e2->nxt = e3;     e3->nxt = e1;     e1r = make_shared<Edge>(b, a, i);     e2r = make_shared<Edge>(c, b, i);     e3r = make_shared<Edge>(a, c, i);     e1r->nxt = e3r;     e2r->nxt = e1r;     e3r->nxt = e2r;     e1->rev = e1r;     e2->rev = e2r;     e3->rev = e3r;     e1r->rev = e1;     e2r->rev = e2;     e3r->rev = e3;     addFlip(e1);     addFlip(e2);     addFlip(e3);     addFlip(e1r);     addFlip(e2r);     addFlip(e3r);   }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int t, n;     cin >> t;     for (int caseNum = 0; caseNum < t; caseNum++) {       cin >> n;       enumeration.clear();       cutOrder.clear();       edgeSet.clear();       for (int i = 1; i <= n - 2; i++) {         int a, b, c;         cin >> a >> b >> c;         addTriangle(a, b, c, i);       }       shared_ptr<Edge> e1 = edgeSet.begin()->second;       search(e1, e1->from);       for (auto e : enumeration) {         cout << e <<    ;       }       cout <<   n ;       for (auto e : cutOrder) {         cout << e <<    ;       }       cout <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int slimes, values;     vector<int> vec;     cin >> slimes;     for (int i = 0; i < slimes; i++) {       vec.push_back(1);       while (vec.size() > 1 && vec[vec.size() - 1] == vec[vec.size() - 2]) {         vec.pop_back();         vec[vec.size() - 1] += 1;       }     }     for (int j = 0; j < vec.size(); j++) {       cout << vec[j] <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, x;     cin >> n >> x;     long long a[n], b[n];     for (int i = 0; i < n; ++i) cin >> a[i];     for (int i = 0; i < n; ++i) cin >> b[i];     sort(a, a + n, greater<int>());     sort(b, b + n);     long long ans = 0, f, id = 0;     for (int i = 0; i < n; ++i) {       f = 0;       while (id < n) {         if (a[i] + b[id] >= x) {           f = 1;           ++id;           break;         }         ++id;       }       if (f)         ++ans;       else         break;     }     cout <<  1   << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, r, s1, s2, d;     cin >> n;     r = ceil(double(sqrt(n)));     s1 = r * r;     s2 = (r - 1) * (r - 1);     d = s1 - s2;     d = d / 2;     d = s1 - d;     if (n < d) {       cout << (r * 2) - 1;     } else {       cout << r * 2;     }   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const int inf = 0x3f3f3f3f;   const int maxn = 1e5 + 5;   void Solution() {     int n;     cin >> n;     cout << (n / 2) + 1 <<   n ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) Solution();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline long long read() {     long long x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   int n;   int a[2000010];   int main() {     while (~scanf( %d , &n)) {       for (int i = 1; i <= n; i++) a[i] = i;       for (int k = 2; k <= n; k++) {         int ed = n + k - 1, rp = n / k + (n % k != 0);         for (int t = k - 1 + (rp - 1) * k; t >= k - 1; t -= k) {           swap(a[ed], a[t]);           ed = t;         }       }       for (int i = n; i <= 2 * n - 1; i++) printf( %d  , a[i]);       puts(  );     }   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const int MAXX = 2e6 + 10;   long long phi(long long n) {     long long ret = n;     for (long long i = 2; i * i <= n; i++) {       if (n % i == 0) {         while (n % i == 0) n /= i;         ret -= ret / i;       }     }     if (n > 1) ret -= ret / n;     return ret;   }   int main() {     long long n, k;     scanf( %lld %lld , &n, &k);     k = (k + 1) / 2;     long long ans = n;     while (k--) {       ans = phi(ans);       if (ans == 1) break;     }     printf( %lld , ans % mod);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 2e5 + 7;   const long long inf = 0x3f3f3f3f;   signed main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     long long t;     cin >> t;     while (t--) {       double pi = 3.1415926535897932384626433832795028841971, n;       cin >> n;       long long sum = n / 2;       double x = 0.5 / tan(pi / (n * 2)), y = 0.5 / sin(pi / (n * 2));       printf( %.10lf n , x * 2);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool comp(pair<long long, long long> a, pair<long long, long long> b) {     return a.first > b.first;   }   long long findBest(vector<pair<long long, long long> > &ps, long long x) {     long long res = 0;     for (long long i = 0; i < ps.size(); i++) {       long long num = ps[i].second;       long long diff = ps[i].first;       if (x - num >= 0) {         res += (num * diff);         x -= num;       } else {         res += (x * diff);         break;       }     }     return res;   }   int main() {     long long n, s;     cin >> n >> s;     vector<pair<long long, long long> > ps;     long long total = 0;     long long positives = 0;     long long pieces = 0;     for (long long i = 0; i < n; i++) {       long long num, a, b;       cin >> num >> a >> b;       ps.push_back(make_pair(a - b, num));       total += num * b;       pieces += num;       if (a - b > 0) {         positives += num;       }     }     sort(ps.begin(), ps.end(), comp);     long long pizzas = (pieces % s == 0) ? (pieces / s) : (pieces / s + 1);     long long extra = pizzas * s - pieces;     long long best = total;     if (positives > 0) {       best = max(best, findBest(ps, positives / s * s) + total);       if (positives % s != 0) {         long long x = max(positives, (positives / s + 1) * s - extra);         best = max(best, findBest(ps, x) + total);       }     }     cout << best << endl;     return 0;   }
#include <bits/stdc++.h>   using ll = long long;   using namespace std;   int n, k, a[110];   int main() {     ios::sync_with_stdio(false);     cin >> n >> k;     for (int i = 0; i < k; ++i) cin >> a[i];     vector<int> s;     for (int i = 1; i <= n; ++i) s.push_back(i);     int curr_leader = 0;     for (int i = 0; i < k; ++i) {       int elim = (curr_leader + a[i]) % n;       cout << s[elim] <<    ;       s.erase(s.begin() + elim);       curr_leader = elim;       n--;     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long n, k;     string s;     cin >> k;     vector<long long> cnt(10, 0);     for (long long i = 0; i < 4; i++) {       cin >> s;       for (long long j = 0; s[j]; j++) {         if (s[j] >=  0  && s[j] <=  9 ) cnt[s[j] -  0 ]++;       }     }     for (long long i = 0; i < 10; i++) {       if (cnt[i] > 2 * k) {         cout <<  NO ;         return;       }     }     cout <<  YES ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long t = 1, n, a, b, m;     while (t--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 2;   long long gcd(long long a, long long b) {     if (b > a) {       return gcd(b, a);     }     if (b == 0) {       return a;     }     return gcd(b, a % b);   }   long long expo(long long a, long long b, long long mod) {     long long res = 1;     while (b > 0) {       if (b & 1) res = (res * a) % mod;       a = (a * a) % mod;       b = b >> 1;     }     return res;   }   long long mminvprime(long long a, long long b) { return expo(a, b - 2, b); }   vector<long long> sieve(int n) {     int* arr = new int[n + 1]();     vector<long long> vect;     for (int i = 2; i <= n; i++)       if (arr[i] == 0) {         vect.push_back(i);         for (int j = 2 * i; j <= n; j += i) arr[j] = 1;       }     return vect;   }   long long mod_add(long long a, long long b, long long m) {     a = a % m;     b = b % m;     return (((a + b) % m) + m) % m;   }   long long mod_mul(long long a, long long b, long long m) {     a = a % m;     b = b % m;     return (((a * b) % m) + m) % m;   }   long long mod_sub(long long a, long long b, long long m) {     a = a % m;     b = b % m;     return (((a - b) % m) + m) % m;   }   long long mod_div(long long a, long long b, long long m) {     a = a % m;     b = b % m;     return (mod_mul(a, mminvprime(b, m), m) + m) % m;   }   int fact[N];   void precalc() {     fact[0] = 1;     for (int i = 1; i < N; i++) {       fact[i] = mod_mul(fact[i - 1], i, 1000000007);     }   }   long long mod(long long x) {     return ((x % 1000000007 + 1000000007) % 1000000007);   }   long long inv(long long x) { return expo(x, 1000000007 - 2, 1000000007); }   long long divide(long long a, long long b) {     return mod_mul(a, inv(b), 1000000007);   }   long long nCr(long long n, long long r) {     return divide(fact[n], mod_mul(fact[r], fact[n - r], 1000000007));   }   long long computeXOR(long long n) {     if (n % 4 == 0) return n;     if (n % 4 == 1) return 1;     if (n % 4 == 2) return n + 1;     return 0;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long t;     cin >> t;     while (t--) {       int a, b;       cin >> a >> b;       int pXor;       if (a % 4 == 1) {         pXor = a - 1;       } else if (a % 4 == 2) {         pXor = 1;       } else if (a % 4 == 3) {         pXor = a;       } else {         pXor = 0;       }       if (pXor == b) {         cout << a <<   n ;       } else if ((pXor ^ b) != a) {         cout << a + 1 <<   n ;       } else {         cout << a + 2 <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200005;   const int INF = 0x3f3f3f3f;   int d, n, m;   struct Sta {     int x, p;     Sta() {}     Sta(int x, int p) : x(x), p(p) {}     void read() { scanf( %d%d , &x, &p); }     bool operator<(const Sta& c) const { return x < c.x; }   } p[N];   struct Node {     int Min, Minid;   } node[N << 2];   void pushup(int x) {     node[x].Min = min(node[(x << 1)].Min, node[(x << 1) | 1].Min);     if (node[x].Min == node[(x << 1) | 1].Min)       node[x].Minid = node[(x << 1) | 1].Minid;     if (node[x].Min == node[(x << 1)].Min) node[x].Minid = node[(x << 1)].Minid;   }   void build(int L = 1, int R = m, int x = 1) {     if (L == R) {       node[x].Min = p[L].p;       node[x].Minid = L;       return;     }     int mid = (L + R) >> 1;     build(L, mid, (x << 1));     build(mid + 1, R, (x << 1) | 1);     pushup(x);   }   int Min, Minid;   void getMin(int l, int r, int L = 1, int R = m, int x = 1) {     if (L >= l && R <= r) {       if (Min > node[x].Min) {         Min = node[x].Min;         Minid = node[x].Minid;       }       return;     }     int mid = (L + R) >> 1;     if (l <= mid) getMin(l, r, L, mid, (x << 1));     if (r > mid) getMin(l, r, mid + 1, R, (x << 1) | 1);   }   long long solve() {     int s = 0;     long long ans = 0;     int yu = 0;     while (s < m) {       int v = upper_bound(p + s + 1, p + m + 1, Sta(p[s].x + n, 0)) - p - 1;       if (v == s) return -1;       Min = INF;       getMin(s + 1, v);       if (Min > p[s].p) {         ans += 1LL * (n - yu) * p[s].p;         yu = n;         yu -= p[Minid].x - p[s].x;         s = Minid;       } else {         for (int j = s + 1; j <= Minid; j++) {           if (p[j].p <= p[s].p) {             int dis = p[j].x - p[s].x;             if (yu >= dis) {               yu -= dis;             } else {               ans += 1LL * (dis - yu) * p[s].p;               yu = 0;             }             s = j;             break;           }         }       }     }     return ans;   }   int main() {     scanf( %d%d%d , &d, &n, &m);     p[0] = Sta(0, 0);     for (int i = 1; i <= m; i++) p[i].read();     p[++m] = Sta(d, 0);     sort(p, p + m + 1);     build();     printf( %lld n , solve());     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k, ans = 0, odd = 0, ev = 0;     cin >> n;     int a[n + 1];     for (int i = 0; i < n; i++) {       cin >> a[i];       if (a[i] & 1)         odd++;       else         ev++;     }     if (n == 1) {       if (odd)         cout <<  Yes ;       else         cout <<  No ;       return 0;     }     if (a[0] % 2 == 0 || a[n - 1] % 2 == 0) {       cout <<  No ;     } else {       if (n & 1) {         if (odd >= 2)           cout <<  Yes ;         else           cout <<  No ;       } else {         cout <<  No ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long gcd(long long n, long long m) { return m == 0 ? n : gcd(m, n % m); }   long long lcm(long long n, long long m) { return (m * n) / gcd(n, m); }   long long dx[] = {1, 0};   long long dy[] = {0, 1};   const long long inf = 1e9 + 10;   const long long INF = 1e18;   long long const N = 2e5 + 10;   long long const M = 5100;   double const PI = acos(-1);   long long const MOD = 998244353;   long long Check(long long n, long long pos) { return n & (1 << pos); }   long long Set(long long n, long long pos) { return n |= (1 << pos); }   long long n, m;   vector<pair<long long, long long> > store;   vector<long long> k;   long long visit[N];   bool check(long long now) {     memset(visit, 0, sizeof(visit));     pair<long long, long long> pt = {now, n};     auto it = upper_bound((store.begin()), (store.end()), pt);     it--;     long long pos = it - store.begin();     vector<pair<long long, long long> > apes;     for (long long i = pos; i >= 0; i--) {       long long day = store[i].first;       long long type = store[i].second;       if (visit[type] == 0) {         apes.push_back({day, type});         visit[type] = 1;       }     }     reverse((apes.begin()), (apes.end()));     long long taka = 0;     long long extra = 0;     long long lastDay = 0;     for (long long i = 0; i < (long long)apes.size(); i++) {       long long day = apes[i].first;       lastDay = day;       long long type = apes[i].second;       if (i == 0)         taka += day;       else         taka += day - apes[i - 1].first;       if (k[type] <= taka)         taka -= k[type];       else {         extra += k[type] - taka;         taka = 0;       }     }     taka += now - lastDay;     for (long long i = 0; i < n; i++) {       if (visit[i] == 0) extra += k[i];     }     extra <<= 1;     if (taka >= extra)       return true;     else       return false;   }   int32_t main() {     cin >> n >> m;     k.resize(n);     for (long long i = 0; i < n; i++) {       cin >> k[i];     }     for (long long i = 0; i < m; i++) {       long long day, type;       cin >> day >> type;       type--;       store.push_back({day, type});     }     sort((store.begin()), (store.end()));     long long res = 1;     long long left = 1, right = 1e11;     while (left <= right) {       long long mid = (left + right) >> 1;       if (check(mid)) {         res = mid;         right = mid - 1;       } else {         left = mid + 1;       }     }     cout << res <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   const int MX = 100010;   int t[MX];   int main() {     int n;     cin >> n;     for (int i = (1); i <= (n); ++i) {       scanf( %d , &t[i]);     }     for (int i = (1); i <= (n); ++i) {       printf( %d  , t[i] + t[i + 1]);     }   }