malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long dpf[110][100][60];   long long dpg[110][100][60];   int diff;   int likes_init = 0;   const long long mod = 998244353;   long long fast_exp(long long b, int e) {     b = b % mod;     if (e == 0) return 1;     if (e == 1) return b;     if (e % 2 == 1) return (b * fast_exp(b, e - 1)) % mod;     return fast_exp((b * b) % mod, e / 2);   }   long long modinv(long long x) {     assert(x % mod != 0);     return fast_exp(x, mod - 2);   }   long long f(int curr, int likes, int runs) {     if (dpf[curr][likes - likes_init][runs] == 1LL << 40) {       int dislike = likes + runs - diff;       if (curr == 0) return 0;       if (runs == 0) {         return curr;       }       if (dislike < 0) return 0;       long long tmp1, tmp2, tmp3;       tmp1 = (curr == 0 ? 0 : curr * f(curr + 1, likes + 1, runs - 1));       tmp2 =           (likes - curr == 0 ? 0 : (likes - curr) * f(curr, likes + 1, runs - 1));       tmp3 = (dislike == 0 ? 0 : dislike * f(curr, likes, runs - 1));       long long tmp = (tmp1 + tmp2 + tmp3) % mod;       long long ans = (tmp * modinv(likes + dislike)) % mod;       return dpf[curr][likes - likes_init][runs] = ans;     } else {       return dpf[curr][likes - likes_init][runs];     }   }   long long g(int curr, int likes, int runs) {     if (dpg[curr][likes - likes_init][runs] == 1LL << 40) {       int dislike = likes + runs - diff;       if (curr == 0) return 0;       if (runs == 0) {         return curr;       }       if (dislike < 0) return 0;       long long tmp1 = (curr == 0 ? 0 : curr * g(curr - 1, likes, runs - 1));       long long tmp2 = (likes == 0 ? 0 : likes * g(curr, likes + 1, runs - 1));       long long tmp3 =           (dislike - curr == 0 ? 0 : (dislike - curr) * g(curr, likes, runs - 1));       long long tmp = (tmp1 + tmp2 + tmp3) % mod;       long long ans = (tmp * modinv(likes + dislike)) % mod;       return dpg[curr][likes - likes_init][runs] = ans;     } else {       return dpg[curr][likes - likes_init][runs];     }   }   int main() {     int n, m;     cin >> n >> m;     diff = m;     int a[n];     for (int i = 0; i < 110; i++) {       for (int j = 0; j < 100; j++) {         for (int k = 0; k < 60; k++) {           dpf[i][j][k] = 1LL << 40;           dpg[i][j][k] = 1LL << 40;         }       }     }     bool good[n];     int tl = 0;     for (int i = 0; i < n; i++) {       cin >> good[i];     }     for (int i = 0; i < n; i++) {       cin >> a[i];       if (good[i]) {         diff += a[i];         tl += a[i];       } else         diff -= a[i];     }     likes_init = tl;     for (int i = 0; i < n; i++) {       if (good[i]) {         cout << (f(a[i], tl, m) % mod + mod) % mod <<   n ;       } else {         cout << (g(a[i], tl, m) % mod + mod) % mod <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int i, j, k, m = 0, n, cnt = 0, x = 0, ans = 0, y, sum = 0, l = 0,                            r = 0;     cin >> n >> m;     string a[n];     for (i = 0; i < n; i++) {       cin >> a[i];     }     for (i = 0; i < n; i++) {       for (j = 0; j < m; j++) {         if (a[i][j] ==  B ) {           for (k = j; k < m; k++) {             if (a[i][k] ==  B ) {               cnt++;             } else {               break;             }           }           cnt = cnt / 2;           i += cnt;           j += cnt;           i++;           j++;           cout << i <<     << j;           return 0;         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1010;   int n, m, a[MAXN];   int main() {     cin.tie(0);     int T;     cin >> T;     while (T--) {       int ans = 0;       cin >> n >> m;       for (register int i = 1; i <= n; ++i) cin >> a[i];       if (n > m || n == 2) {         puts( -1 );         continue;       }       for (register int i = 1; i <= n; ++i) ans += a[i] + a[i];       m -= n;       int minn1 = 0x3f3f3f3f, minn2 = 0x3f3f3f3f, p1, p2;       for (register int i = 1; i <= n; ++i) {         if (a[i] < minn1)           p2 = p1, p1 = i, minn2 = minn1, minn1 = a[i];         else if (a[i] < minn2)           minn2 = a[i], p2 = i;       }       ans += m * (minn1 + minn2);       printf( %d n , ans);       for (register int i = 1; i <= m; ++i) printf( %d %d n , p1, p2);       for (register int i = 2; i <= n; ++i) printf( %d %d n , i, i - 1);       printf( 1 %d n , n);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   struct Data {     int u, v, w;     Data() {}     Data(int x, int y, int z) : u(x), v(y), w(z) {}   };   int n;   vector<Data> edge, ans;   vector<int> neighbor[N];   void dfs(int u, int par, vector<int> &leaf) {     if (neighbor[u].size() == 1) {       leaf.push_back(u);       return;     }     for (auto v : neighbor[u])       if (v != par) dfs(v, u, leaf);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 1; i < n; i++) {       int x, y, w;       cin >> x >> y >> w;       edge.push_back(Data(x, y, w));       neighbor[x].push_back(y);       neighbor[y].push_back(x);     }     for (int i = 1; i <= n; i++)       if (neighbor[i].size() == 2) return cout <<  NO , 0;     cout <<  YES n ;     for (auto Q : edge) {       int u = Q.u, v = Q.v, w = Q.w;       vector<int> Uleaf, Vleaf;       dfs(u, v, Uleaf);       dfs(v, u, Vleaf);       int u1 = Uleaf.front(), u2 = Uleaf.back();       int v1 = Vleaf.front(), v2 = Vleaf.back();       ans.push_back(Data(u1, v1, w / 2));       ans.push_back(Data(u2, v2, w / 2));       if (u1 != u2) ans.push_back(Data(u1, u2, -w / 2));       if (v1 != v2) ans.push_back(Data(v1, v2, -w / 2));     }     cout << ans.size() <<   n ;     for (auto Q : ans) {       int u = Q.u, v = Q.v, w = Q.w;       cout << u <<     << v <<     << w <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   int a[200003], b[200003], ch[200003];   void Do() {     int n, f = 0;     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n; i++) cin >> b[i];     for (int i = 0; i < n - 1; i++) {       if (a[i] == 0) f = 1;       if (f) a[i] = a[i + 1];     }     f = 0;     for (int i = 0; i < n - 1; i++) {       if (b[i] == 0) f = 1;       if (f) b[i] = b[i + 1];     }     int beg = a[0], desire;     ch[0] = a[0];     for (int i = 0; i < n - 1; i++)       if (b[i] == beg) desire = i;     int ind = 1;     for (int i = desire + 1; i < n - 1; i++) {       ch[ind++] = b[i];       if (ind == n - 1) break;     }     if (ind != n - 1) {       for (int i = 0;; i++) {         ch[ind++] = b[i];         if (ind == n - 1) break;       }     }     bool flag = true;     for (int i = 0; i < n - 1; i++)       if (a[i] != ch[i]) flag = false;     if (flag)       cout <<  YES  << endl;     else       cout <<  NO  << endl;   }   int main() {     Do();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long power(long long a, long long n) {     if (a == 0) return 0;     if (a == 1 || n == 0) return 1;     if (n == 1) return a % 1000000007;     long long t = power(a, n / 2);     t = t * t % 1000000007;     if (n & 1) return t * a % 1000000007;     return t;   }   int popcount(long long a) {     int c = 0;     while (a) {       c++;       a -= a & -a;     }     return c;   }   void factorize(int a) {}   void update(int tree[], int idx, int val, int maxval) {     for (; idx <= maxval; idx += idx & -idx) {       tree[idx] += val;     }   }   int read(int tree[], int idx) {     long long sum = 0;     for (; idx > 0; idx -= idx & -idx) {       sum += tree[idx];     }     return sum;   }   struct node2 {     int id, val;     node2() {       static int ctx = 1;       id = ctx++;     };     node2(int a, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0) {       val = a;     }   };   struct comp2 {     bool operator()(int a, int b) { return b < a; }   };   bool cmp2(int a, int b) { return b < a; }   struct node {     long long x, y;   };   struct comp {     bool operator()(int a, int b) { return b < a; }   };   bool cmp(int a, int b) { return b < a; }   int n, m, a, b, c, d, k, h, w, x, y, p, q, t, res, ma, mi, T, act = 0, pas = 1,                                                                 cur, flag, now;   int deg[100009];   char s[1];   double e, f, z;   vector<int> v[100009], vec;   node ans[100009];   set<int> sett;   map<int, int> mapp;   void print() {}   void print2() {}   void input() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     for (int i = 1; i < n; i++) {       cin >> x >> y;       v[x].push_back(y);       v[y].push_back(x);       deg[x]++;       deg[y]++;     }   }   int Y[] = {0, 1, 0, -1, 0};   int X[] = {0, 0, 1, 0, -1};   int bgfjsvf[] = {0, 3, 4, 1, 2};   void calc(int id, int par, long long y, long long x, long long dist, int dir) {     ans[id].x = x;     ans[id].y = y;     int block = 1;     for (auto u : v[id]) {       if (u == par) continue;       if (block == dir) block++;       calc(u, id, y + Y[block] * dist, x + X[block] * dist, dist / 2,            bgfjsvf[block]);       block++;     }   }   void solve() {     for (int i = 1; i < n + 1; i++)       if (deg[i] > 4) {         flag = 1;         return;       }     calc(1, 0, 0, 0, 1e9, 0);   }   void output() {     if (flag == 1)       cout <<  NO ;     else {       cout <<  YES  << endl;       for (int i = 1; i < n + 1; i++) cout << ans[i].x <<     << ans[i].y << endl;     }   }   int main() {     input();     solve();     output();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int LEN = 100009;   int n;   int a[LEN];   int ch = 0, nech = 0;   int ans = 0;   int main() {     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n; i++) {       if (a[i] % 2 == 0)         ch++;       else         nech++;     }     ans = min(ch, nech);     while (nech > 1) {       nech -= 2;       ch++;       ans = max(ans, min(ch, nech));     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   set<pair<long long, long long> > st;   const long long INF = 1 << 30;   const long long N = 100005;   long long p[N], n, m;   long long nxt[N], pre[N];   long long a[N], x[N];   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 << 1) + (x << 3) + (ch ^ 48);       ch = getchar();     }     return x * f;   }   bool cmp(long long x, long long y) { return p[x] < p[y]; }   long long calc(long long x, long long y) {     if (x == y) return INF;     long long d = (p[y] - p[x] + m) % m;     if (x > y) d = (d + a[y]) % m;     if (d <= a[x]) return 1;     if (a[x] <= a[y]) return INF;     long long dis = a[x] - a[y];     return (d - a[y] - 1) / dis + 1;   }   signed main() {     n = read();     m = read();     for (long long i = 1; i <= n; i++) {       p[i] = read();       a[i] = read();       x[i] = i;     }     sort(x + 1, x + n + 1, cmp);     for (long long i = 1; i <= n; i++) {       if (i < n)         nxt[x[i]] = x[i + 1];       else         nxt[x[i]] = x[1];       pre[nxt[x[i]]] = x[i];     }     for (long long i = 1; i <= n; i++) {       st.insert(make_pair(calc(i, nxt[i]), i));     }     while (!st.empty()) {       set<pair<long long, long long> >::iterator it = st.begin();       if ((*it).first == INF) break;       long long i = (*it).second;       st.erase(it);       st.erase(make_pair(calc(nxt[i], nxt[nxt[i]]), nxt[i]));       st.erase(make_pair(calc(pre[i], i), pre[i]));       p[i] += calc(i, nxt[i]);       --a[i];       nxt[i] = nxt[nxt[i]];       pre[nxt[i]] = i;       st.insert(make_pair(calc(pre[i], i), pre[i]));       st.insert(make_pair(calc(i, nxt[i]), i));     }     printf( %d n , st.size());     for (set<pair<long long, long long> >::iterator it = st.begin();          it != st.end(); it++)       printf( %lld  , (*it).second);   }
#include <bits/stdc++.h>   using namespace std;   int h, t, R;   int n, m;   vector<pair<int, int> > H, T;   int D[201][201];   int shortestWin() {     memset(D, -1, sizeof(D));     queue<pair<int, int> > q;     for (int i = 1; i <= n; i++) {       pair<int, int> s;       s.first = i;       s.second = 0;       if (i <= R && H[i - 1].first == 0 && H[i - 1].second == 0) {         q.push(s);         D[i][0] = 1;       }     }     for (int i = 1; i <= m; i++) {       pair<int, int> s;       s.first = 0;       s.second = i;       if (i <= R && T[i - 1].first == 0 && T[i - 1].second == 0) {         q.push(s);         D[0][i] = 1;       }     }     while (!q.empty()) {       pair<int, int> u = q.front();       q.pop();       for (int i = 0; i < n; i++) {         pair<int, int> v;         v.first = u.first + (i + 1) - (H[i].first);         v.second = u.second - (H[i].second);         if (v.first + v.second <= R) {           if (v.first >= 0 && v.second >= 0 && v.first >= (i + 1)) {             if (D[v.first][v.second] == -1) {               D[v.first][v.second] = D[u.first][u.second] + 1;               q.push(v);             }           }         }       }       for (int i = 0; i < m; i++) {         pair<int, int> v;         v.first = u.first - (T[i].first);         v.second = u.second + (i + 1) - (T[i].second);         if (v.first + v.second <= R) {           if (v.first >= 0 && v.second >= 0 && v.second >= (i + 1)) {             if (D[v.first][v.second] == -1) {               D[v.first][v.second] = D[u.first][u.second] + 1;               q.push(v);             }           }         }       }     }     return D[h][t];   }   int V[201][201];   int dp(int h, int t) {     if (h + t > R || h < 0 || t < 0) {       return 0;     }     if (V[h][t] == 1) {       return 1000000000;     }     if (D[h][t] != -1) {       return D[h][t];     }     V[h][t] = 1;     int best = 0;     for (int i = 0; i < n; i++) {       if (i + 1 > h) break;       int vh = h - (i + 1) + H[i].first;       int vt = t + H[i].second;       best = max(best, dp(vh, vt) + 1);     }     for (int i = 0; i < m; i++) {       if (i + 1 > t) break;       int vh = h + T[i].first;       int vt = t - (i + 1) + T[i].second;       best = max(best, dp(vh, vt) + 1);     }     D[h][t] = best;     V[h][t] = 2;     return D[h][t];   }   int main() {     cin >> h >> t >> R;     cin >> n;     H.resize(n);     for (int i = 0; i < n; i++) {       cin >> H[i].first >> H[i].second;     }     cin >> m;     T.resize(m);     for (int i = 0; i < m; i++) {       cin >> T[i].first >> T[i].second;     }     int winningPath = shortestWin();     if (winningPath != -1) {       cout <<  Ivan n  << winningPath <<   n ;     } else {       memset(D, -1, sizeof(D));       memset(V, 0, sizeof(V));       int losingPath = dp(h, t);       if (losingPath >= 1000000000) {         cout <<  Draw n ;       } else {         cout <<  Zmey n  << losingPath <<   n ;       }     }   }
#include <bits/stdc++.h>   const int MAXN = 300011;   int N;   struct Pair {     int Val;     long long Mask;   } P[MAXN];   long long Sum;   int main() {     scanf( %d , &N);     for (int i = 1; i <= N; ++i) {       scanf( %d%I64d , &P[i].Val, &P[i].Mask);       Sum += P[i].Val;     }     if (Sum < 0LL) {       for (int i = 1; i <= N; ++i) P[i].Val = -P[i].Val;     }     long long Ans = 0LL, Tmp;     for (int i = 61; i >= 0; --i) {       Tmp = 0LL;       for (int j = 1; j <= N; ++j)         if ((P[j].Mask >> i) & 1 && ((P[j].Mask & ((1LL << i) - 1)) == 0))           Tmp += P[j].Val;       if (Tmp > 0LL) {         Ans ^= (1LL << i);         for (int j = 1; j <= N; ++j)           if ((P[j].Mask >> i) & 1) P[j].Val = -P[j].Val;       }     }     printf( %I64d n , Ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 200010;   const int mod = 1e9 + 7;   namespace DSU {   int fa[maxn], cycle[maxn], sz[maxn];   void init() {     for (int i = 1; i < maxn; i++) fa[i] = i, sz[i] = 1, cycle[i] = 0;   }   int find_set(int x) {     if (x == fa[x])       return x;     else       return fa[x] = find_set(fa[x]);   }   void union_set(int x, int y) {     int fx = find_set(x);     int fy = find_set(y);     if (fx == fy) {       cycle[fx] = 1;     } else {       fa[fy] = fx;       sz[fx] += sz[fy];       cycle[fx] |= cycle[fy];     }   }   }  // namespace DSU   using namespace DSU;   int main() {     int n;     cin >> n;     init();     long long ans = 1;     for (int i = 1; i <= n; i++) {       int x, y;       cin >> x >> y;       if (x == y) {         cycle[find_set(x)] = 2;         continue;       }       union_set(x, y);     }     for (int i = 1; i <= 2 * n; i++) {       if (find_set(i) == i) {         if (cycle[i] == 1)           ans = ans * 2 % mod;         else {           if (cycle[i] == 0) ans = ans * sz[i] % mod;         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 50 + 5;   int R, C, K;   char g[maxn][maxn];   int sx, sy, tx, ty;   bool flag[300];   int mindist;   string ans;   const int dx[] = {0, 1, -1, 0};   const int dy[] = {1, 0, 0, -1};   bool mark[maxn][maxn];   int dist[maxn][maxn];   string board[maxn][maxn];   set<pair<int, int> > grid[maxn * maxn];   void calc() {     memset(dist, -1, sizeof dist);     memset(mark, false, sizeof mark);     queue<pair<int, int> > q;     dist[tx][ty] = 0;     board[tx][ty] =   ;     q.push(make_pair(tx, ty));     while (!q.empty()) {       int x = q.front().first;       int y = q.front().second;       q.pop();       for (int i = 0; i < 4; ++i) {         int xx = x + dx[i], yy = y + dy[i];         if (xx >= 0 && xx < R && yy >= 0 && yy < C &&             (flag[g[xx][yy]] || g[xx][yy] ==  S )) {           if (dist[xx][yy] == -1) {             dist[xx][yy] = dist[x][y] + 1;             q.push(make_pair(xx, yy));           }         }       }     }     if (dist[sx][sy] == -1) return;     string ret =   ;     int curd = dist[sx][sy];     grid[curd].clear();     grid[curd].insert(make_pair(sx, sy));     while (curd > 0) {       char best =  z  + 1;       for (set<pair<int, int> >::iterator it = grid[curd].begin();            it != grid[curd].end(); ++it) {         for (int i = 0; i < 4; ++i) {           int xx = it->first + dx[i], yy = it->second + dy[i];           if (xx >= 0 && xx < R && yy >= 0 && yy < C &&               dist[xx][yy] + 1 == curd) {             if (g[xx][yy] < best) {               best = g[xx][yy];               grid[curd - 1].clear();               grid[curd - 1].insert(make_pair(xx, yy));             } else if (best == g[xx][yy]) {               grid[curd - 1].insert(make_pair(xx, yy));             }           }         }       }       ret += best;       curd--;     }     ret = ret.substr(0, (int)ret.size() - 1);     if (mindist == -1 || dist[sx][sy] < mindist ||         dist[sx][sy] == mindist && ret < ans) {       ans = ret;       mindist = dist[sx][sy];     }   }   void dfs(int dep, int last) {     if (last == 26) {       if (dep == 0) {         calc();       }       return;     }     dfs(dep, last + 1);     if (dep > 0) {       flag[ a  + last] = 1;       dfs(dep - 1, last + 1);       flag[ a  + last] = 0;     }   }   int main() {     scanf( %d%d%d , &R, &C, &K);     for (int i = 0; i < R; ++i) {       scanf( %s , g[i]);     }     for (int i = 0; i < R; ++i) {       for (int j = 0; j < C; ++j) {         if (g[i][j] ==  S ) {           sx = i;           sy = j;         }         if (g[i][j] ==  T ) {           tx = i;           ty = j;         }       }     }     if (abs(sx - tx) + abs(tx - ty) == 1) {       puts(  );       return 0;     }     ans =   ;     mindist = -1;     memset(flag, 0, sizeof flag);     dfs(K, 0);     if (mindist == -1) {       printf( %d n , -1);     } else {       puts(ans.c_str());     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int board[9][9];   int bBoard[9][9];   int best, N, M;   void saveBoard() {     for (int i = 0; i < N; i++)       for (int j = 0; j < M; j++) bBoard[i][j] = board[j][i];   }   void printBoard() {     for (int i = 0; i < N; i++, cout << endl)       for (int j = 0; j < M; j++)         cout << (char)(bBoard[i][j] +  A  ==  A  ?  .  : bBoard[i][j] +  A  - 1);   }   int dx[][5] = {       {0, -1, -2, -1, -1},       {-2, 0, -1, -2, -2},       {-1, -1, 0, -1, -2},       {0, 0, -1, -2, 0},   };   int dy[][5] = {       {0, 0, 0, -1, -2},       {0, -1, -1, -1, -2},       {0, -1, -2, -2, -2},       {0, -1, -1, -1, -2},   };   bool place(int x, int y, int cur, int t) {     for (int i = 0; i < 5; i++) {       int nx = x + dx[t][i], ny = y + dy[t][i];       if (nx < 0 || ny < 0 || board[nx][ny]) return false;     }     for (int i = 0; i < 5; i++) {       int nx = x + dx[t][i], ny = y + dy[t][i];       board[nx][ny] = cur;     }     return true;   }   void unplace(int x, int y, int cur, int t) {     for (int i = 0; i < 5; i++) {       int nx = x + dx[t][i], ny = y + dy[t][i];       board[nx][ny] = 0;     }   }   void search(int x, int y, int cur) {     if (M * (N - y) + M - x <= 5 * (best - cur)) return;     if (x == M) {       y++;       x = 0;     }     if (y == N) {       if (cur > best) {         best = cur;         saveBoard();       }       return;     }     for (int i = 0; i < 4; i++) {       if (place(x, y, cur, i)) {         search(x + 1, y, cur + 1);         unplace(x, y, cur, i);       }     }     search(x + 1, y, cur);   }   int main() {     cin >> N >> M;     search(0, 0, 1);     cout << (best - 1) << endl;     printBoard();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e6 + 5;   const int mod = 1e9 + 7;   const long long INF = 2e15;   long long qpower(long long a, long long b) {     long long ans = 1;     while (b > 0) {       if (b & 1) ans = ans * a % mod;       b >>= 1;       a = a * a % mod;     }     return ans;   }   long long n, k;   int main(int argc, char const *argv[]) {     std::cin >> n >> k;     if (k == 0) {       std::cout << n <<   n ;       return 0;     }     int cnt = 0;     for (int i = 0; i < k; i++) {       if (n % 10 == 0) {         cnt++;         n /= 10;       } else         break;     }     for (int i = cnt; i < k; i++) {       if (n % 5 == 0) n /= 5;       if (n % 2 == 0) n /= 2;     }     for (int i = 1; i <= k; i++) {       n *= 10;     }     std::cout << n <<   n ;     return 0;   }