malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   inline int read() {     int 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;   }   const int N = 1e5 + 7;   pair<int, int> q[N];   int n, m, fa[N << 1], a[N];   int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }   int main() {     n = read(), m = read();     for (int i = 1; i <= n; i++) a[i] = !read();     for (int i = 1; i <= m; i++) fa[i] = i, fa[i + m] = i + m;     for (int i = 1; i <= m; i++) {       int opt = read();       for (int j = 1; j <= opt; j++) {         int v = read();         if (!q[v].first)           q[v].first = i;         else           q[v].second = i;       }     }     for (int i = 1; i <= n; i++) {       int x1 = find(q[i].first), x2 = find(q[i].first + m);       int y1 = find(q[i].second), y2 = find(q[i].second + m);       if (a[i]) {         fa[x1] = y2;         x2 = find(x2), y1 = find(y1);         fa[x2] = y1;       } else {         fa[x1] = y1;         x2 = find(x2), y2 = find(y2);         fa[x2] = y2;       }     }     for (int i = 1; i <= m; i++) {       if (find(i) == find(i + m)) {         printf( NO );         return 0;       }     }     printf( YES );   }
#include <bits/stdc++.h>   using namespace std;   int m1[502][502], m2[502][502];   int num[502], lie[502];   vector<int> v;   const int INF = 0x3f3f3f3f;   int main(void) {     int a, b, i, j, flag = 1, sum = 0;     scanf( %d %d , &a, &b);     for (i = 0; i < a; i++) {       for (j = 0; j < b; j++) {         scanf( %d , &m1[i][j]);       }     }     for (i = 0; i < a; i++) {       for (j = 0; j < b; j++) {         scanf( %d , &m2[i][j]);       }     }     for (i = 0; i < b; i++) {       num[i] = lie[i] = 0;     }     for (i = 0; i < a; i++) {       for (j = 0; j < b; j++) {         num[j] += m1[i][j] ^ m2[i][j];         lie[i] += m1[i][j] ^ m2[i][j];       }     }     for (i = 0; i < b; i++) {       if (num[i] % 2) {         flag = 0;         break;       }     }     for (i = 0; i < a; i++) {       if (lie[i] % 2) {         flag = 0;         break;       }     }     if (flag) {       printf( Yes n );     } else {       printf( No n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, c = 0, se = 0, so = 0, soo = 0, see = 0;     cin >> n;     int a[n];     for (int i = 0; i < n; i++) {       cin >> a[i];       if (i % 2 == 0)         so += a[i];       else         se += a[i];     }     for (int i = 0; i < n; i++) {       if (i % 2 == 0)         soo += a[i];       else         see += a[i];       int t = se - see;       int t1 = so - soo;       if ((i + 1) % 2 == 0)         see -= a[i];       else         soo -= a[i];       if (see + t1 == soo + t) c++;       if ((i + 1) % 2 == 0)         see += a[i];       else         soo += a[i];     }     cout << c << endl;     ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int a, b, n, i, t, r = 0;     while (cin >> t) {       for (i = 0; i < t; i++) {         cin >> a >> b >> n;         if (n % 3 == 1)           cout << b << endl;         else if (n % 3 == 0)           cout << a << endl;         else {           r = a ^ b;           cout << r << endl;           r = 0;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 500009;   const int mod = 1000000007;   int n, m, x, y;   vector<int> v[N];   vector<bool> vis;   bool is;   void pre() { vis.assign(N, 0); }   void dfs(int ver, int par) {     vis[ver] = 1;     for (auto &it : v[ver]) {       if (it == par) continue;       if (vis[it] == 1) {         is = 1;         continue;       }       dfs(it, ver);     }   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin.exceptions(cin.failbit);     ;     pre();     cin >> n >> m;     for (int i = 0; i < m; i++) {       cin >> x >> y;       v[x].push_back(y);       v[y].push_back(x);     }     int ans = 0;     for (int i = 1; i <= n; i++) {       if (vis[i]) continue;       is = 0;       dfs(i, -1);       ans++;       if (is) ans--;     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int mod = 1e9 + 7;   double pi = 3.1415926535;   long long int gcd(long long int a, long long int b) {     if (b == 0) {       return a;     }     return gcd(b, a % b);   }   long long int power(long long int a, long long int n) {     long long int res = 1;     while (n) {       if (n % 2) {         res = res * a;       }       n = n / 2;       a = a * a;     }     return res;   }   bool checkprime(long long int n) {     for (long long int i = 2; i * i <= n; i++) {       if (n % i == 0) {         return false;       }     }     return true;   }   long long int mpow(long long int a, long long int n) {     long long int res = 1;     while (n) {       if (n % 2) {         res = (res * a) % mod;       }       a = (a * a) % mod;       n = n / 2;     }     return res;   }   void solve() {     string s;     cin >> s;     map<int, int> mp;     int n = s.size();     int cnt = 0;     vector<int> v;     for (int i = 0; i < n; i++) {       cnt = 0;       while (i < n && s[i] ==  1 ) {         i++;         cnt++;       }       v.push_back(cnt);     }     int a[101] = {0}, ans = 0;     bool f = true;     sort(v.begin(), v.end(), greater<int>());     for (auto c : v) {       if (f) {         ans += c;         f = false;       } else {         f = true;       }     }     cout << ans << endl;   }   int main() {     long long int t = 1;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline T read() {     char c = getchar();     T x = 0, f = 1;     while (!isdigit(c)) {       if (c ==  - ) f = -1;       c = getchar();     }     while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();     return x * f;   }   template <typename T>   inline void write(T x) {     if (x < 0) x = (~x) + 1, putchar( - );     if (x / 10) write(x / 10);     putchar(x % 10 | 48);   }   const int INF = 0x3f3f3f3f;   long long int qz[200005][30];   long long int ans[30];   int main() {     int T = read<int>();     while (T--) {       memset(ans, 0, sizeof(ans));       int n = read<int>(), m = read<int>();       for (int i = 1; i <= n; i++) {         char c;         cin >> c;         int a = c -  a ;         ans[a]++;         for (int j = 0; j < 26; j++) qz[i][j] = qz[i - 1][j];         qz[i][a] = qz[i - 1][a] + 1;       }       for (int i = 0; i < m; i++) {         int a = read<int>();         for (int j = 0; j < 26; j++) {           ans[j] += qz[a][j];         }       }       for (int i = 0; i < 26; i++) {         cout << ans[i] <<    ;       }       cout << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 310;   map<int, int> Map;   int l[MAXN], c[MAXN], n;   int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %d , &l[i]);     for (int i = 1; i <= n; ++i) scanf( %d , &c[i]);     for (int i = 1; i <= n; ++i) {       if (Map[l[i]])         Map[l[i]] = min(Map[l[i]], c[i]);       else         Map[l[i]] = c[i];       for (map<int, int>::iterator it = Map.begin(); it != Map.end(); it++) {         int x = gcd(l[i], it->first);         if (Map[x])           Map[x] = min(Map[x], c[i] + it->second);         else           Map[x] = c[i] + it->second;       }     }     if (Map[1])       printf( %d , Map[1]);     else       printf( -1 );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MN = 1000 * 100 + 10;   const int inf = (1 << 29);   string s, t, ans, tmp;   int cnt[30], curr[30];   int main() {     cin >> s >> t;     sort(s.rbegin(), s.rend());     for (int i = 0; i < s.size(); i++) cnt[s[i] -  a ]++;     if (s <= t)       cout <<  -1 n ;     else {       for (int i = t.size() - (t.size() == s.size()); i >= 0; i--) {         bool good = true;         for (int j = 0; j < 26; j++) curr[j] = cnt[j];         for (int j = 0; j < i; j++) {           curr[t[j] -  a ]--;           if (curr[t[j] -  a ] < 0) good = false;         }         if (!good) continue;         char c =  z  + 1;         if (i < t.size()) {           for (int j = 0; j < 26; j++)             if (curr[j] && j > t[i] -  a ) c = min(c, (char)(j +  a ));           if (c <=  z )             curr[c -  a ]--;           else             continue;         }         for (int j = 0; j < i; j++) ans.push_back(t[j]);         if (i < t.size()) ans.push_back(c);         for (int j = 0; j < 26; j++) {           while (curr[j]) {             ans.push_back((char)(j +  a ));             curr[j]--;           }         }         cout << ans << endl;         break;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     scanf( %d %d , &n, &m);     map<unsigned long long, vector<int>> pow;     vector<int> a(m + 1), s(m + 1), u(m + 1), b(n + 1);     for (int i = 1; i <= n; ++i) {       unsigned long long p;       scanf( %llu , &p);       pow[p].push_back(i);     }     for (int i = 1; i <= m; ++i) scanf( %llu , &s[i]);     int c = 0, us = 0;     for (int i = 0; i < 32; ++i) {       for (int j = 1; j <= m; ++j) {         if (!u[j] && pow.count(s[j]) && !pow[s[j]].empty()) {           u[j] = 1;           us += i;           c++;           int cp = pow[s[j]].back();           pow[s[j]].pop_back();           b[cp] = j;           a[j] = i;         } else           s[j] = (s[j] + 1) / 2;       }     }     printf( %d %d n , c, us);     for (int i = 1; i <= m; ++i) {       printf( %d  , a[i]);     }     printf(  n );     for (int i = 1; i <= n; ++i) {       printf( %d  , b[i]);     }     printf(  n );   }
#include <bits/stdc++.h>   using namespace std;   struct Point {     double x, y;     Point(double x = 0, double y = 0) : x(x), y(y) {}     Point operator+(Point b) { return Point(x + b.x, y + b.y); }     Point operator-(Point b) { return Point(x - b.x, y - b.y); }     double operator^(Point b) { return x * b.y - y * b.x; }     Point operator*(double b) { return Point(x * b, y * b); }     double operator*(Point b) { return x * b.x + y * b.y; }     inline double dis() { return sqrt(*this * *this); }   };   struct tcurts {     double r;     int type;     bool operator<(const tcurts &b) const { return r < b.r; }   } q[100010 * 2];   int main() {     Point A, B, C;     scanf( %lf%lf%lf%lf , &A.x, &A.y, &B.x, &B.y), C = (A + B) * 0.5;     Point normal = (B - A) * (1 / (B - A).dis());     normal = Point(-normal.y, normal.x);     int n, top = 0;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       Point p;       double R;       scanf( %lf%lf%lf , &p.x, &p.y, &R);       int flag = ((p - A) ^ (B - A)) > 0;       double l = -1e12, r = 1e12;       for (int times = 1; times <= 80; times++) {         double mid = (l + r) / 2;         Point O = C + normal * mid;         if ((O - A).dis() + R < (p - O).dis())           (flag ? r : l) = mid;         else           (flag ? l : r) = mid;       }       q[++top] = (tcurts){l, flag ? -1 : 1}, l = -1e12, r = 1e12;       for (int times = 1; times <= 80; times++) {         double mid = (l + r) / 2;         Point O = C + normal * mid;         if ((O - A).dis() - R > (p - O).dis())           (flag ? l : r) = mid;         else           (flag ? r : l) = mid;       }       q[++top] = (tcurts){l, flag ? 1 : -1};     }     q[++top] = (tcurts){-1e12, 0}, q[++top] = (tcurts){1e12, 0},     q[++top] = (tcurts){0, 0}, sort(q + 1, q + top + 1);     double res = 1e12;     bool flag = false;     for (int i = 1, s = 0; i <= top; i++) {       if (!s) res = min(res, fabs(q[i].r)), flag = true;       s += q[i].type;       if (!s) res = min(res, fabs(q[i].r)), flag = true;     }     if (!flag)       puts( -1 );     else       printf( %.10lf n , (C + normal * res - A).dis());   }
#include <bits/stdc++.h>   using namespace std;   int const N = 400400;   int const mod = 1000000007;   void add(int &a, int b) {     if ((a += b) >= mod) a -= mod;   }   int prod(int a, int b) {     auto x = (unsigned long long)a * b;     unsigned int xh = x >> 32, xl = x, q, r;     asm( divl %4;  n t  :  =a (q),  =d (r) :  d (xh),  a (xl),  r (mod));     return r;   }   int sum[N], sq[N], down[N];   void apply(int v, int l, int r, int val) {     add(sq[v], prod(2, prod(sum[v], val)));     add(sq[v], prod(val, prod(val, r - l)));     add(sum[v], prod(val, r - l));     add(down[v], val);   }   void push(int v, int l, int r) {     int m = (l + r) / 2;     apply(2 * v + 1, l, m, down[v]);     apply(2 * v + 2, m, r, down[v]);     down[v] = 0;   }   void add(int v, int l, int r, int from, int to, int val) {     if (r <= from || to <= l) return;     if (from <= l && r <= to) {       apply(v, l, r, val);       return;     }     push(v, l, r);     int m = (l + r) / 2;     add(2 * v + 1, l, m, from, to, val);     add(2 * v + 2, m, r, from, to, val);     sum[v] = sum[2 * v + 1] + sum[2 * v + 2];     add(sum[v], 0);     sq[v] = sq[2 * v + 1] + sq[2 * v + 2];     add(sq[v], 0);   }   int get_sq(int v, int l, int r, int from, int to) {     if (r <= from || to <= l) return 0;     if (from <= l && r <= to) return sq[v];     push(v, l, r);     int m = (l + r) / 2;     int ans =         get_sq(2 * v + 1, l, m, from, to) + get_sq(2 * v + 2, m, r, from, to);     add(ans, 0);     return ans;   }   int n;   vector<pair<int, int>> g[N];   int tin[N], tout[N];   void dfs(int v, int par) {     static int timer = 0;     tin[v] = timer++;     for (auto e : g[v]) {       if (e.first != par) {         dfs(e.first, v);         add(0, 0, n, tin[e.first], tout[e.first], e.second);       }     }     tout[v] = timer;   }   int ans[N];   vector<pair<int, int>> qs[N];   void calc(int v, int par) {     for (auto q : qs[v]) {       int cur = get_sq(0, 0, n, tin[q.first], tout[q.first]);       int all = get_sq(0, 0, n, 0, n);       ans[q.second] = prod(2, cur);       add(ans[q.second], mod - all);     }     for (auto e : g[v]) {       if (e.first != par) {         add(0, 0, n, 0, n, e.second);         add(0, 0, n, tin[e.first], tout[e.first], mod - prod(2, e.second));         calc(e.first, v);         add(0, 0, n, 0, n, mod - e.second);         add(0, 0, n, tin[e.first], tout[e.first], prod(2, e.second));       }     }   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n - 1; ++i) {       int a, b, c;       scanf( %d%d%d , &a, &b, &c);       --a, --b;       g[a].emplace_back(b, c);       g[b].emplace_back(a, c);     }     dfs(0, -1);     int q;     scanf( %d , &q);     for (int i = 0; i < q; ++i) {       int u, v;       scanf( %d%d , &u, &v);       --u, --v;       qs[u].emplace_back(v, i);     }     calc(0, -1);     for (int i = 0; i < q; ++i) cout << ans[i] <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int x[2010], y[2010];   long long nc2(long long n) { return (n * n - n) / 2LL; }   int main() {     int T, n, caseNo = 0;     map<pair<int, int>, long long> cnt;     scanf( %d , &n);     for (int i = 0; i <= n - 1; i++) {       scanf( %d %d , &x[i], &y[i]);       x[i] *= 2;       y[i] *= 2;     }     for (int i = 0; i <= n - 1; i++) {       for (int j = i + 1; j <= n - 1; j++) {         int midX = x[i] + x[j];         int midY = y[i] + y[j];         cnt[{midX, midY}]++;       }     }     long long ans = 0LL;     map<pair<int, int>, long long>::iterator it;     for (it = cnt.begin(); it != cnt.end(); it++) {       long long Cnt = it->second;       ans += nc2(Cnt);     }     printf( %lld n , ans);     cnt.clear();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   class Node {     set<int> adj;       public:     bool isLeave() const { return adj.size() == 1; }     void add(int v) { adj.insert(v); }     void remove(int v) { adj.erase(v); }     int front() const { return *adj.begin(); }   };   const int N = 100001;   Node neighbors[N];   bool marked[N] = {};   int level[N] = {};   int pred[N] = {};   list<int>::iterator sortedPos[N];   int main() {     int n;     cin >> n;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       neighbors[u].add(v);       neighbors[v].add(u);     }     cout << 1;     if (n == 1) {       cout << endl;     } else if (n == 2) {       cout <<     << 2 << endl;     } else {       list<int> leaves, sorted;       for (int i = 1; i <= n; i++) {         if (neighbors[i].isLeave()) leaves.push_back(i);         sortedPos[i] = sorted.end();       }       {         while (!leaves.empty()) {           const int u = leaves.front();           leaves.pop_front();           if (neighbors[u].isLeave()) {             const int v = neighbors[u].front();             if (level[u] + 1 > level[v]) {               level[v] = level[u] + 1;               pred[v] = u;               if (sortedPos[v] != sorted.end()) sorted.erase(sortedPos[v]);               assert(sorted.empty() || level[v] >= level[sorted.front()]);               sorted.push_front(v);               sortedPos[v] = sorted.begin();             }             neighbors[u].remove(v);             neighbors[v].remove(u);             if (neighbors[v].isLeave()) leaves.push_back(v);           }         }         int k = 2;         int controlled = 0;         int v = sorted.front();         sorted.pop_front();         controlled += level[v] + 1;         assert(!marked[v]);         marked[v] = true;         v = pred[v];         while (v) {           assert(!marked[v]);           marked[v] = true;           v = pred[v];         }         while (!sorted.empty() && controlled < n - 1) {           v = sorted.front();           sorted.pop_front();           if (!marked[v]) {             controlled += level[v] + 1;             marked[v] = true;             v = pred[v];             while (v) {               assert(!marked[v]);               marked[v] = true;               v = pred[v];             }             cout <<     << controlled;             k++;           }         }         for (; k <= n; k++) {           if (controlled < n) controlled++;           cout <<     << controlled;         }         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 111;   const int LIMIT = 10000;   const double eps = 1e-6;   int a[N], b[N];   int n, m;   int isSq(long long t) {     long long tt = (long long)sqrt(t + eps);     return tt * tt == t;   }   void gen(int n, int a[]) {     bool flag = false;     while (!flag) {       long long total = 0;       for (int i = 1; i < n; i++) {         a[i] = rand() % LIMIT + 1;         total += 1LL * a[i] * a[i];       }       for (int i = 1; i <= LIMIT; i++) {         long long t = total + i * i;         a[n] = i;         if (isSq(t)) {           flag = true;           break;         }       }     }   }   int main() {     scanf( %d %d , &n, &m);     gen(n, a);     gen(m, b);     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         printf( %d%c , a[i] * b[j], j == m ?   n  :    );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool cycle[3001];   int vis[3001];   vector<vector<int> > adj;   bool f;   int node;   bool getC(int ind, int prev) {     if (cycle[ind]) {       node = ind;       return 1;     }     cycle[ind] = 1;     for (int i = 0; i < (int)adj[ind].size(); i++)       if (prev != adj[ind][i] && getC(adj[ind][i], ind)) {         if (!f)           cycle[ind] = 0;         else           vis[ind] = 0;         if (ind == node) f = 0;         return 1;       }     cycle[ind] = 0;     return 0;   }   void dfs(int ind, int l) {     vis[ind] = l;     for (int i = 0; i < (int)adj[ind].size(); i++) {       if (vis[adj[ind][i]] == -1) dfs(adj[ind][i], l + 1);     }   }   int main() {     memset(vis, -1, sizeof vis);     int n;     f = 1;     scanf( %d , &n);     adj = vector<vector<int> >(n + 1);     int a, b;     for (int i = 0; i < (int)n; i++) {       scanf( %d%d , &a, &b);       adj[a].push_back(b);       adj[b].push_back(a);     }     getC(1, -1);     for (int i = 1; i <= n; i++)       if (cycle[i]) {         dfs(i, 0);       }     for (int i = 1; i <= n; i++) cout << vis[i] <<    ;     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     long long a, b;     cin >> a >> b;     if (b < a || (b - a) % 2)       cout << -1 << endl;     else if (b == a && a == 0)       cout << 0 << endl;     else if (b == a)       cout << 1 << endl << a;     else {       long long x = 0, cnt = 1, pp = b - a;       while (cnt <= pp) cnt *= 2;       cnt /= 2;       while (true) {         if (cnt * 2 <= pp) {           x += cnt;           pp -= cnt * 2;         }         cnt /= 2;         if (pp == 0) break;       }       long long tt = a ^ x;       if (tt == a + x)         cout << 2 << endl << a + x <<     << x << endl;       else         cout << 3 << endl << a <<     << x <<     << x << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = (int)1e9 + 7;   const int MOD2 = 1007681537;   const int INF = (int)1e9;   const long long LINF = (long long)1e18;   const long double PI = acos((long double)-1);   const long double EPS = 1e-9;   inline long long gcd(long long a, long long b) {     long long r;     while (b) {       r = a % b;       a = b;       b = r;     }     return a;   }   inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }   inline long long fpow(long long n, long long k, int p = MOD) {     long long r = 1;     for (; k; k >>= 1) {       if (k & 1) r = r * n % p;       n = n * n % p;     }     return r;   }   template <class T>   inline int chkmin(T& a, const T& val) {     return val < a ? a = val, 1 : 0;   }   template <class T>   inline int chkmax(T& a, const T& val) {     return a < val ? a = val, 1 : 0;   }   inline long long isqrt(long long k) {     long long r = sqrt(k) + 1;     while (r * r > k) r--;     return r;   }   inline long long icbrt(long long k) {     long long r = cbrt(k) + 1;     while (r * r * r > k) r--;     return r;   }   inline void addmod(int& a, int val, int p = MOD) {     if ((a = (a + val)) >= p) a -= p;   }   inline void submod(int& a, int val, int p = MOD) {     if ((a = (a - val)) < 0) a += p;   }   inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }   inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }   inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }   inline int sign(long double x, long double y) { return sign(x - y); }   long long ff(long long n, long long k) {     return min(k + k, k + (n - k) * (n - k - 1) / 2);   }   void solve() {     int test;     cin >> test;     while (test--) {       long long n;       cin >> n;       if (n <= 4) {         cout << n - 1 <<   n ;         continue;       }       long long lo = 1, hi = n - 3;       while (lo < hi) {         long long mi = lo + hi >> 1;         if (ff(n, mi) > ff(n, mi + 1)) {           hi = mi;         } else {           lo = mi + 1;         }       }       cout << max(n - 1, ff(n, lo + hi >> 1)) <<   n ;     }   }   int main() {     int JUDGE_ONLINE = 1;     if (fopen( in.txt ,  r )) {       JUDGE_ONLINE = 0;       assert(freopen( in.txt ,  r , stdin));     } else {       ios_base::sync_with_stdio(0), cin.tie(0);     }     solve();     if (!JUDGE_ONLINE) {     }     return 0;   }