malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n;     cin >> n;     int a, b, c;     cin >> a >> b >> c;     string s;     cin >> s;     vector<int> brr[26];     int p1 =  R  -  A ;     int p2 =  P  -  A ;     int p3 =  S  -  A ;     for (int i = 0; i < s.size(); ++i) {       brr[s[i] -  A ].emplace_back(i);     }     string ans;     for (int i = 0; i < n; ++i) {       ans +=  * ;     }     int cnt = 0;     while (brr[p1].size()) {       if (b == 0) break;       ans[brr[p1].back()] =  P ;       brr[p1].pop_back();       --b;       ++cnt;     }     while (brr[p2].size()) {       if (c == 0) break;       ans[brr[p2].back()] =  S ;       brr[p2].pop_back();       --c;       ++cnt;     }     while (brr[p3].size()) {       if (a == 0) break;       ans[brr[p3].back()] =  R ;       brr[p3].pop_back();       --a;       ++cnt;     }     int half = ceil(n / 2.0);     if (cnt >= half) {       for (int i = 0; i < ans.size(); ++i) {         if (ans[i] ==  * ) {           if (a > 0)             ans[i] =  R , --a;           else if (b > 0)             ans[i] =  P , --b;           else if (c > 0)             ans[i] =  S , --c;         }       }       assert(a == 0 && b == 0 && c == 0);       cout <<  YES n  << ans <<   n ;     } else {       cout <<  NO n ;     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int T;     cin >> T;     while (T--) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   int a[30];   bool mark[N];   bool dp[30][1000];   int n;   void update() {     dp[0][0] = 1;     for (int i = 1; i <= n; i++)       for (int j = 0; j < 1000; j++) {         dp[i][j] = dp[i - 1][j];         if (j >= a[i] && !mark[i]) dp[i][j] |= dp[i - 1][j - a[i]];       }   }   int main() {     ios_base::sync_with_stdio(0);     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     sort(a + 1, a + n + 1);     update();     int k = n;     for (int i = 1; i <= n; i++) {       int t = a[i] - 1;       for (int j = i - 1; j >= 1; j--) {         if (a[j] != a[i] - 1 && a[j] <= t && !mark[j] && dp[j - 1][t - a[j]]) {           update();           mark[j] = 1;           t -= a[j];           k--;         }       }       if (t) k = 200;     }     if (k == 1)       cout <<  YES ;     else       cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long a[2][2010];   long long b[2010];   int dp[2010][2010][2];   int way[2010][2010][2];   int sz[2];   int r(int p1, int p2, int w) {     if ((p1 == sz[0]) && (p2 == sz[1])) return 0;     if (dp[p1][p2][w] != -1) return dp[p1][p2][w];     if ((p1 == 0) && (p2 == 0)) {       int v1 = r(p1 + 1, p2, 0);       int v2 = r(p1, p2 + 1, 1);       if (v1 < v2)         way[p1][p2][w] = 0;       else         way[p1][p2][w] = 1;       return dp[p1][p2][w] = ((v1 < v2) ? (v1) : (v2));     }     long long last;     if (w == 0)       last = a[0][p1 - 1];     else       last = a[1][p2 - 1];     int res1 = 2000000000, res2 = 2000000000;     if (p1 != sz[0]) {       int t = 0;       if (a[0][p1] < last) t = 1;       res1 = t + r(p1 + 1, p2, 0);     }     if (p2 != sz[1]) {       int t = 0;       if (a[1][p2] < last) t = 1;       res2 = t + r(p1, p2 + 1, 1);     }     if (res1 < res2)       way[p1][p2][w] = 0;     else       way[p1][p2][w] = 1;     return dp[p1][p2][w] = ((res1 < res2) ? (res1) : (res2));   }   int main() {     int it;     scanf( %d , &it);     for (int i = (0); i < (it); ++i) {       scanf( %d , &sz[i]);       cin >> a[i][0];       int x, y, m;       cin >> x >> y >> m;       for (int j = (1); j < (sz[i]); ++j) a[i][j] = (a[i][j - 1] * x + y) % m;     }     memset(dp, -1, sizeof(dp));     int res = r(0, 0, 0);     cout << res << endl;     int p1 = 0, p2 = 0, w = 0;     while ((p1 < sz[0]) || (p2 < sz[1])) {       if (way[p1][p2][w] == 0) {         printf( %d 1 n , a[0][p1]);         p1++;         w = 0;       } else {         printf( %d 2 n , a[1][p2]);         p2++;         w = 1;       }     }     return 0;   }
#include <bits/stdc++.h>   const int MAXN = 100 * 1000;   int a[MAXN + 10];   int dp[MAXN + 10];   int mx = 0;   using namespace std;   int main() {     long long n, m, k, s = 0;     cin >> k >> n >> m;     long long shif = (k - (n % k)) % k;     n = n + shif;     if (m < n)       cout << 0 << endl;     else       cout << (m - n) / k + 1 << endl;   }
#include <bits/stdc++.h>   using namespace std;   int a[(1 << 17) + 1];   int tree[4 * (1 << 17)];   void build(int nd, int s, int e, bool ex) {     if (s == e) {       tree[nd] = a[s];       return;     }     int mid = (s + e) / 2;     int left = 2 * nd;     int right = 2 * nd + 1;     build(left, s, mid, !ex);     build(right, mid + 1, e, !ex);     if (ex) {       tree[nd] = tree[left] ^ tree[right];     } else {       tree[nd] = tree[left] | tree[right];     }   }   void update(int nd, int s, int e, int p, int v, bool ex) {     if (s == e && s == p) {       tree[nd] = v;       return;     }     if (e < p || s > p) return;     int mid = (s + e) / 2;     int left = 2 * nd;     int right = 2 * nd + 1;     update(left, s, mid, p, v, !ex);     update(right, mid + 1, e, p, v, !ex);     if (ex) {       tree[nd] = tree[left] ^ tree[right];     } else {       tree[nd] = tree[left] | tree[right];     }   }   int main() {     int n, m, total;     cin >> n >> m;     total = (1 << n);     for (int i = 1; i <= total; i++) {       scanf( %d , a + i);     }     build(1, 1, total, !(n & 1));     int p, v;     while (m--) {       scanf( %d %d , &p, &v);       update(1, 1, total, p, v, !(n & 1));       cout << tree[1] << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   string s;   queue<int> q[2];   int main() {     ios_base::sync_with_stdio();     cin.tie();     cin >> n >> s;     for (int i = 0; i < n; i++) {       if (s[i] ==  D ) {         q[0].push(i);       }       if (s[i] ==  R ) {         q[1].push(i);       }     }     while (q[1].size() > 0 && q[0].size() > 0) {       int x = q[0].front();       int y = q[1].front();       if (x < y) {         q[1].pop();         q[0].pop();         q[0].push(x + n);       } else {         q[0].pop();         q[1].pop();         q[1].push(y + n);       }     }     if (q[0].size()) {       cout <<  D n ;     } else {       cout <<  R n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, q;   pair<int, int> t[300100];   pair<int, int> up[300100];   pair<int, int> down[300100];   pair<int, int> inter(pair<int, int> a, pair<int, int> b) {     int f = max(a.first, b.first);     int s = min(a.second, b.second);     pair<int, int> res = {f, s};     return res;   }   long long int len(pair<int, int> a) {     int res = a.second - a.first;     if (res < 0) res = 0;     return res;   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) cin >> t[i].first >> t[i].second;     down[0] = t[0];     up[n - 1] = t[n - 1];     for (int i = 0; i < n - 1; i++) down[i + 1] = inter(down[i], t[i + 1]);     for (int i = n - 1; i > 0; i--) up[i - 1] = inter(up[i], t[i - 1]);     long long int ma = -1;     ma = max(ma, len(up[1]));     ma = max(ma, len(down[n - 2]));     for (int i = 1; i < n - 1; i++) {       long long int a = len(inter(down[i - 1], up[i + 1]));       ma = max(ma, a);     }     cout << ma;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int min(int x, int y) { return x < y ? x : y; }   int max(int x, int y) { return x > y ? x : y; }   void swap(int &x, int &y) {     int t;     t = x, x = y, y = t;   }   char s[200000];   int main() {     int x, y, i, j, n, k, t;     while (~scanf( %d%d , &n, &k)) {       if ((k + n - 1) / n == 2) {         printf( %d n , n);         continue;       }       for (i = 0;; i++) {         t = k - i * 2;         if (t == 0) break;         if (n - i <= 0) {           i--;           break;         }         if ((t) / (n - i) > 2) {           break;         }       }       printf( %d n , i);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   const ll inf = INT_MAX - 1;   bool check(ll r, ll g, ll b, ll w, ll total) {     if (r < 0 || g < 0 || b < 0 || w < 0) {       return false;     }     ll numberIsOne = 0;     if (r & 1) {       numberIsOne++;     }     if (g & 1) {       numberIsOne++;     }     if (b & 1) {       numberIsOne++;     }     if (w & 1) {       numberIsOne++;     }     if (numberIsOne == 0 && total % 2 == 0) {       return true;     }     if (total % 2 == 1 && numberIsOne == 1) {       return true;     }   }   void solve() {     ll r, g, b, w;     cin >> r >> g >> b >> w;     ll total = r + g + b + w;     ll minNum = min(r, min(g, b));     if (check(r, g, b, w, total)) {       cout <<  Yes n ;       return;     }     if (check(r - 1, g - 1, b - 1, w + 3, total)) {       cout <<  Yes n ;       return;     }     if (check(r - 2, g - 2, b - 2, w + 6, total)) {       cout <<  Yes n ;       return;     }     if (check(r - minNum, g - minNum, b - minNum, w + minNum * 3, total)) {       cout <<  Yes n ;       return;     }     cout <<  No n ;   }   int main() {     ios_base::sync_with_stdio(false);     ll t;     cin >> t;     while (t--) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-7;   const long long INFF = 1e18;   const int INF = 1e9;   const int mod = 1e9 + 7;   const int MAX = 2e7 + 7;   vector<long long> st1, st2;   int main(void) {     long long a, b;     scanf( %lld %lld , &a, &b);     ;     long long c = a + b;     for (long long i = 1; i <= MAX; ++i) {       if (i * i > a) break;       if (a % i == 0) st1.push_back(i);     }     int tp = ((int)st1.size()) - 1;     for (int i = tp; i >= 0; --i) st1.push_back(a / st1[i]);     for (long long i = 1; i <= MAX; ++i) {       if (i * i > b) break;       if (b % i == 0) st2.push_back(i);     }     tp = ((int)st2.size()) - 1;     for (int i = tp; i >= 0; --i) st2.push_back(b / st2[i]);     long long ans = INFF;     for (long long i = 1; i <= MAX; ++i) {       if (i * i > c) break;       if (c % i == 0) {         bool ok = 0;         long long n = i, m = c / i;         long long n1 = *(--upper_bound((st1).begin(), (st1).end(), n));         if (m >= a / n1) ok = 1;         n1 = *(--upper_bound((st1).begin(), (st1).end(), m));         if (n >= a / n1) ok = 1;         n1 = *(--upper_bound((st2).begin(), (st2).end(), n));         if (m >= b / n1) ok = 1;         n1 = *(--upper_bound((st2).begin(), (st2).end(), m));         if (n >= b / n1) ok = 1;         if (ok) ans = min(ans, 2 * (n + m));       }     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       string second;       cin >> second;       int mi = 0, gr = 0, le = 0, ans = 0;       for (int i = 0; i < second.length(); i++) {         if (second[i] ==  - )           mi++;         else if (second[i] ==  > )           gr++;         else           le++;       }       if (mi == n || gr == n || le == n) {         cout << n << endl;         continue;       }       if (mi == 0 && gr && le) {         cout << 0 << endl;         continue;       }       if ((mi && gr && !le) || (mi && le && !gr)) {         cout << n << endl;         continue;       }       for (int i = 0; i < second.length(); i++) {         if (second[i] ==  -  || second[(i - 1 + n) % n] ==  - ) ans++;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 1e5 + 7;   const int MOD = 1e9 + 7;   int a[MAX], h[MAX], c[MAX] = {0};   int main() {     int n, m, i, j, k, q;     scanf( %d %d %d , &n, &k, &m);     for (i = 0; i < n; i++) scanf( %d , &a[i]);     for (i = 0; i < n; i++) {       h[i] = a[i] % m;       c[h[i]]++;     }     for (i = 0; i < m; i++)       if (c[i] >= k) break;     if (i == m) {       printf( No n );       return 0;     }     printf( Yes n );     j = i, q = 0;     for (i = 0; i < n && q < k; i++) {       if (h[i] == j) printf( %d  , a[i]), q++;     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long logN = 20;   const long long M = 1000000007;   const long long INF = 1e12;   const long long N = 100005;   const long int maxi = 1000000;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long n, m, h1, i, j;     cin >> n >> m >> h1;     long long a[m];     for (i = 0; i < m; i++) {       cin >> a[i];     }     long long b[n];     for (i = 0; i < n; i++) {       cin >> b[i];     }     long long h[n][m], ans[n][m];     for (i = 0; i < n; i++) {       for (j = 0; j < m; j++) {         cin >> h[i][j];         ans[i][j] = 0;       }     }     for (i = 0; i < m; i++) {       if (a[i] > 0) {         for (j = 0; j < n; j++) {           if (h[j][i] == 1 && a[i] <= b[j]) {             ans[j][i] = a[i];             break;           }         }       }     }     for (i = 0; i < n; i++) {       if (b[i] > 0) {         for (j = 0; j < m; j++) {           if (h[i][j] == 1 && ans[i][j] == 0 && b[i] <= a[j]) {             ans[i][j] = b[i];             break;           }         }       }     }     for (i = 0; i < n; i++) {       for (j = 0; j < m; j++) {         cout << max(ans[i][j], h[i][j]) <<    ;       }       cout << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   inline int solve(int w, int h, int S) {     if (S == (2 * w + 1) * (2 * h + 1)) return 2 * (w + 1) * (h + 1) - 1;     if (S > (2 * w + 1) * (2 * h + 1)) return 0;     S = (2 * w + 1) * (2 * h + 1) - S;     if (S & 3) return 0;     S /= 4;     int res = 0;     for (int w2 = 0; w2 < w; w2++) {       if (S % (w - w2)) continue;       int h2 = h - S / (w - w2);       if (h2 < 0 || h2 >= h) continue;       res++;     }     return 2 * res;   }   int main() {     int W, H, s;     while (scanf( %d%d%d , &W, &H, &s) >= 1) {       long long ans = 0;       for (int w = 0; 2 * w + 1 <= W; w++) {         for (int h = 0; 2 * h + 1 <= H; h++) {           ans += solve(w, h, s) * (long long)(W - (2 * w + 1) + 1) *                  (H - (2 * h + 1) + 1);         }       }       printf(            %lld              n ,           ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<string, int> mp;   int main() {     int T[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};     string s, t, Ans =   , M;     int d = 0, m = 0, y = 0, x = 0;     cin >> s;     for (int i = 0; i <= s.length() - 10; i++) {       t = s.substr(i + 6, 4);       if (t !=  2013  && t !=  2014  && t !=  2015 ) continue;       if (s[i + 2] !=  -  || s[i + 5] !=  - ) continue;       if (s[i + 3] ==  -  || s[i + 4] ==  - ) continue;       if (s[i] ==  -  || s[i + 1] ==  - ) continue;       m = 10 * int(s[i + 3] -  0 ) + int(s[i + 4] -  0 );       d = 10 * int(s[i] -  0 ) + int(s[i + 1] -  0 );       if (m > 12 || d > T[m] || d == 0) continue;       M = s.substr(i, 10);       mp[M]++;       if (mp[M] > x) Ans = M, x = mp[M];     }     cout << Ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n;     cin >> n;     long long int max1 = 0, max2 = 0, min1 = (1000000000 + 9),                   min2 = (1000000000 + 9);     for (int i = 0; i < n; i++) {       long long int x, y;       cin >> x >> y;       if (y < min1) {         min1 = y;       }       if (x > max1) {         max1 = x;       }     }     long long int m;     cin >> m;     for (int i = 0; i < m; i++) {       long long int x, y;       cin >> x >> y;       if (y < min2) {         min2 = y;       }       if (x > max2) {         max2 = x;       }     }     long long int x1 = (max1 - min2);     long long int x2 = (max2 - min1);     long long int x3 = max(x1, x2);     if (x3 < 0) {       cout << 0 << endl;     } else {       cout << x3 << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   #pragma warning(disable : 4996)   #pragma comment(linker,  /STACK:20000007 )   #pragma GCC optimize( unroll-loops )   const int N = (int)1e6 + 100;   const int maxn = (int)1e3 + 100;   const int base = (int)1e9;   const int mod = (int)1e9 + 7;   const int inf = INT_MAX;   const long long ll_inf = LLONG_MAX;   const long double PI = acos((long double)-1.0);   const long double eps = 1e-8;   void solve() {     int n, s;     scanf( %d%d , &n, &s);     vector<int> P(n);     for (int i = 0; i < n; ++i) {       scanf( %d , &P[i]);     }     multiset<int> S;     for (int i = 0; i < n; ++i) {       S.insert(P[i]);     }     map<int, int> C;     for (int i = 0; i < n; ++i) {       C[P[i]]++;     }     int ans = 0;     --s;     if (P[s]) {       C[P[s]]--;       S.erase(S.find(P[s]));       C[0]++;       ++ans;       P[s] = 0;     }     ans += C[0] - 1;     int have = C[0] - 1;     S.erase(0);     int now = 1;     while (!S.empty() && now <= *(--S.end())) {       if (S.find(now) != S.end())         ;       else if (have)         --have;       else {         ++ans;         S.erase(--S.end());       }       ++now;     }     printf( %d n , ans);   }   int main() {     int T = 1;     for (; T; --T) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int det(long long int a, long long int b, int bit) {     if (!bit) {       if (a & 1) return a;       if (b & 1) return b;       return a;     }     if (a & (1ll << bit)) return det(a, b, bit - 1);     if (!(b & (1ll << bit))) return det(a, b, bit - 1);     if ((b & ((1ll << (bit + 1)) - 1)) == ((1ll << (bit + 1)) - 1)) return b;     return ((a & (~((1ll << bit) - 1))) | ((1ll << bit) - 1));   }   int main() {     int n = 0;     cin >> n;     long long int a = 0, b = 0;     while (n--) {       cin >> a >> b;       cout << det(a, b, 60) <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1005;   int n, m, b[N][N], a[N][N];   void solve() {     if (n % 2) {       printf( %d n , n);       return;     }     bool ok = 1;     while (n > 1 && ok && n % 2 == 0) {       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           if (b[i][j] != b[n - i - 1][j]) {             ok = 0;             break;           }         }       }       if (ok) n /= 2;     }     printf( %d n , n);   }   int main() {     ios::sync_with_stdio(false);     scanf( %d %d , &n, &m);     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) scanf( %d , &b[i][j]);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int day[4][48] = {       31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30,       31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,       31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30,       31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,       31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30,       31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,       31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30,       31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};   int a[30];   int main() {     int n;     cin >> n;     int k = 1, vis_28, vis_29;     vis_28 = vis_29 = 0;     for (int i = 0; i < n; i++) {       cin >> a[i];     }     if (vis_28) k = 0;     int flag = 0, x = 0, tmp;     for (int k = 0; k < 4; k++) {       while (x < 36) {         if (day[k][x] == a[0]) {           int i;           for (i = 0; i < n; i++) {             if (a[i] != day[k][(x + i) % 36]) break;           }           if (i == n) {             flag = 1;             break;           }         }         x++;       }     }     if (flag)       cout <<  Yes n ;     else       cout <<  No n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = (int)1e9;   const int mod = inf + 7;   const double eps = 1e-9;   const double pi = acos(-1.0);   int n, t;   int a[100100], cur = 0, all;   int binpow(int a, int k) {     if (k == 0) return 1;     int ans = binpow(a, k / 2);     ans = 1ll * ans * ans % mod;     if (k % 2) ans = 1ll * ans * a % mod;     return ans;   }   int main() {     cin >> n;     int bad = 0;     for (int i = 1; i < 4; i++) {       for (int j = 1; j < 4; j++) {         for (int k = 1; k < 4; k++) {           if (i + j + k == 6) bad++;         }       }     }     bad = binpow(bad, n);     all = binpow(3, 3 * n);     all -= bad;     all %= mod;     all += mod;     all %= mod;     cout << all << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long ceilVal(long long a, long long b) {     long long sum = a / b;     if (a % b) return ++sum;     return sum;   }   int main() {     long long a, n, m;     scanf( %lld%lld%lld , &n, &m, &a);     long long sum = 0;     sum = ceilVal(n, a) * ceilVal(m, a);     printf( %lld , sum);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void p(vector<int> a) {     int x = 0;     for (int y : a) {       if (x) printf(   );       printf( %d , y);       x = 1;     }     puts(  );   }   int main() {     int n;     cin >> n;     if (n % 2 == 0) return !printf( -1 n );     vector<int> a, b, c;     for (int i = 0; i < n; ++i) a.emplace_back(i), b.emplace_back(i);     for (int i = 0; i < n; ++i) c.emplace_back((a[i] + b[i]) % n);     p(a);     p(b);     p(c);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, x, y, sum = 0;     cin >> n >> x >> y;     sum = (n * y) / 100;     if ((n * y) % 100 != 0) {       sum += 1;     }     if (sum <= x)       cout << 0;     else       cout << abs(sum - x);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int n;     cin >> n;     if (n & 1)       cout << n / 2 <<   n ;     else {       long long int p = 1;       for (long long int i = 1; 2 * p <= n; i++) p = 1 << i;       cout << (n - p) / 2 <<   n ;     }     return 0;   }