malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int n, m, fre[11], fre1[11];   string tot, no, cm =   , cm1 =   ;   bool belongs(int x) {     int tmp = x, len = 0, i;     int tmf[11] = {};     while (tmp > 0) {       tmf[(tmp % 10)]++;       tmp /= 10;       len++;     }     if (n - len == x) {       for (i = 0; i < 10; i++) {         if (fre1[i] < tmf[i]) return false;       }       return true;     }     return false;   }   int main() {     int i, j;     cin >> tot;     cin >> no;     if (tot ==  01  || tot ==  10 ) {       cout <<  0 n ;       return 0;     }     n = tot.length();     m = no.length();     for (i = 0; i < n; i++) {       fre[tot[i] - 48]++;       fre1[tot[i] - 48]++;     }     for (i = 0; i < m; i++) {       fre1[no[i] - 48]--;     }     for (i = 1; i <= n; i++) {       if (belongs(i)) {         int tmp = i;         while (tmp > 0) {           fre1[(tmp % 10)]--;           tmp /= 10;         }         break;       }     }     int tm;     for (i = 0; i < 10; i++) {       tm = fre1[i];       while (tm > 0) {         cm1 += (i + 48);         tm--;       }     }     for (i = 1; i < 10; i++) {       if (fre1[i] > 0) {         cm += (i + 48);         fre1[i]--;         break;       }     }     for (i = 0; i < 10; i++) {       tm = fre1[i];       while (tm > 0) {         cm += (i + 48);         tm--;       }     }     if (no[0] ==  0 ) {       i = 1;       n = cm.size();       while (i < n && cm[i] < no[0]) {         i++;       }       string ans1 =   , ans2 =   ;       for (j = 0; j < min(i, n); j++) ans1 += cm[j];       ans1 += no;       for (j = i; j < n; j++) ans1 += cm[j];       i = 1;       while (i < n && cm[i] <= no[0]) {         i++;       }       for (j = 0; j < min(i, n); j++) ans2 += cm[j];       ans2 += no;       for (j = i; j < n; j++) ans2 += cm[j];       string ans;       if (ans1[0] !=  0 ) {         ans = ans1;       } else if (ans2[0] !=  0 ) {         ans = ans2;       }       if (ans1[0] !=  0 ) {         ans = min(ans, ans1);       }       if (ans2[0] !=  0 ) {         ans = min(ans, ans2);       }       cout << ans << endl;     } else {       string ans3 = no + cm1;       i = 1;       n = cm.size();       while (i < n && cm[i] < no[0]) {         i++;       }       string ans1 =   , ans2 =   ;       for (j = 0; j < min(i, n); j++) ans1 += cm[j];       ans1 += no;       for (j = i; j < n; j++) ans1 += cm[j];       i = 1;       while (i < n && cm[i] <= no[0]) {         i++;       }       for (j = 0; j < min(i, n); j++) ans2 += cm[j];       ans2 += no;       for (j = i; j < n; j++) ans2 += cm[j];       string ans;       if (ans1[0] !=  0 ) {         ans = ans1;       } else if (ans2[0] !=  0 ) {         ans = ans2;       } else if (ans3[0] !=  0 ) {         ans = ans3;       }       if (ans1[0] !=  0 ) {         ans = min(ans, ans1);       }       if (ans2[0] !=  0 ) {         ans = min(ans, ans2);       }       if (ans3[0] !=  0 ) {         ans = min(ans, ans3);       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   typedef long long ll;   typedef long l;   typedef pair<int, int> pint;   typedef vector<pint> vpint;   typedef vector<int> vint;   typedef vector<vint> vvint;   int n, m, x[123457], cum[1234567];   int ans;   map<int, int> mp;   int main() {     cin >> n;     for (int i = 0; i < n; ++i) {       cin >> x[i];       cum[i] = x[i];     }     sort(cum, cum + n);     for (int i = 0; i < n; ++i) {       if (x[i] != cum[i]) ans++;     }     if (ans < 3)       cout <<  YES ;     else       cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   struct ma {     int x, vt;   } a[105];   bool cmp(ma p, ma y) { return p.x < y.x; }   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i].x;       a[i].vt = i;     }     sort(a + 1, a + n + 1, cmp);     for (int i = 1; i <= n / 2; i++)       cout << a[i].vt <<     << a[n - i + 1].vt << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dp[300005][35], a[300005];   int main() {     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       a[i] /= 100;     }     for (int i = 0; i <= n; i++)       for (int j = 0; j <= 30; j++) dp[i][j] = 1000000000;     dp[0][0] = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j <= 30; j++) {         dp[i + 1][j + a[i + 1] / 10] =             min(dp[i + 1][j + a[i + 1] / 10], dp[i][j] + a[i + 1]);         dp[i + 1][j - min(j, a[i + 1])] =             min(dp[i + 1][j - min(j, a[i + 1])],                 dp[i][j] + a[i + 1] - min(j, a[i + 1]));       }     }     int maxx = 1000000000;     for (int i = 0; i <= 30; i++) maxx = min(maxx, dp[n][i]);     printf( %d00 n , maxx);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long t;     cin >> t;     long long arr[t], sum = 0;     for (int i = 0; i < t; ++i) {       cin >> arr[i];       sum += arr[i];     }     if (sum != 0) {       cout <<  YES  << endl;       cout << 1 << endl;       cout << 1 <<     << t << endl;       return 0;     }     if (t == 1) {       if (arr[0] != 0) {         cout <<  YES  << endl;         cout << 1 << endl;         cout << 1 << endl;       } else         cout <<  NO  << endl;     } else {       for (int i = 0; i < t; i++) {         sum += arr[i];         if (sum != 0) {           cout <<  YES  << endl;           cout << 2 << endl;           cout << 1 <<     << i + 1 << endl;           cout << i + 2 <<     << t << endl;           return 0;         }       }       cout <<  NO  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long global = 0;   void test_case(long long);   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long t;     int yes = 1;     if (yes)       cin >> t;     else       t = 1;     for (long long T = 0; T < t; T++) {       test_case(T);     }     return 0;   }   void test_case(long long T) {     long long n, m;     cin >> n >> m;     vector<string> vec(n);     for (long long(i) = 0; (i) < n; (i)++) {       cin >> vec[i];     }     vector<long long> x = {0, 1, 0, -1}, y = {1, 0, -1, 0};     long long g = 0;     for (long long(i) = 0; (i) < n; (i)++) {       for (long long(j) = 0; (j) < m; (j)++) {         if (vec[i][j] ==  G ) g++;         if (vec[i][j] ==  B ) {           for (long long k = 0; k < 4; k++) {             long long idx = i + x[k];             long long jdx = j + y[k];             if (idx >= 0 && idx < n && jdx >= 0 && jdx < m) {               if (vec[idx][jdx] ==  G ) {                 cout <<  no  << endl;                 return;               } else if (vec[idx][jdx] ==  . ) {                 vec[idx][jdx] =  # ;               }             }           }         }       }     }     queue<pair<long long, long long>> q;     q.push(pair<long long, long long>(n - 1, m - 1));     map<pair<long long, long long>, long long> v;     v[pair<long long, long long>(n - 1, m - 1)]++;     long long vg = 0;     while (!q.empty()) {       auto f = q.front();       q.pop();       if (vec[f.first][f.second] ==  G )         vg++;       else if (vec[f.first][f.second] ==  # )         break;       for (long long k = 0; k < 4; k++) {         long long idx = f.first + x[k];         long long jdx = f.second + y[k];         if (idx >= 0 && idx < n && jdx >= 0 && jdx < m) {           if (vec[idx][jdx] ==  #  || vec[idx][jdx] ==  B ) continue;           if (!v[pair<long long, long long>(idx, jdx)]) {             v[pair<long long, long long>(idx, jdx)]++;             q.push(pair<long long, long long>(idx, jdx));           }         }       }     }     if (vg == g)       cout <<  yes  << endl;     else       cout <<  no  << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1004;   int cnk[N][N] = {0};   int mod = 1000000007;   void init_cnk() {     for (int i = 0; i < N; ++i) {       cnk[i][0] = 1;       cnk[i][i] = 1;     }     for (int i = 1; i < N; ++i) {       for (int j = 1; j < N; ++j) {         cnk[i][j] = (cnk[i - 1][j - 1] + cnk[i - 1][j]) % mod;       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cout.precision(10);     cout << fixed;     int k;     cin >> k;     vector<int> c(k, 0);     for (int i = 0; i < k; ++i) cin >> c[i];     init_cnk();     int n = c.size();     vector<int> res(n, 0);     res[0] = 1;     int acc = c[0];     for (int i = 1; i < n; ++i) {       int cur = c[i];       for (int j = 0; j < cur; ++j) {         res[i] += (1LL * cnk[acc - 1 + j][j] * res[i - 1]) % (1LL * mod);         res[i] %= mod;       }       acc += cur;     }     cout << res[n - 1] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long MAXN = 300 * 1000 + 7;   const long long MOD = 1000 * 1000 * 1000 + 7;   const long long INF = 1000000000000000 + 7;   const double PI = 2 * acos(0.0);   long long a, b, c;   int main(void) {     cin >> a >> b >> c;     if (a > b || a > c)       cout <<  No  << endl;     else       cout <<  Yes  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int arr[15];     for (int i = 1; i <= 14; i++) cin >> arr[i];     long long int brr[15];     long long int ans = -1;     for (int i = 1; i <= 14; i++) {       if (arr[i] == 0) continue;       for (int j = 1; j <= 14; j++) brr[j] = arr[j];       long long int st = brr[i];       brr[i] = 0;       for (int j = 1; j <= 14; j++) brr[j] += st / 14;       st = st % 14;       int k = i + 1;       if (k > 14) k = 1;       while (st > 0) {         brr[k] += 1;         k = k + 1;         if (k > 14) k = 1;         st--;       }       long long int temp = 0;       for (int j = 1; j <= 14; j++)         if (brr[j] % 2 == 0) temp += brr[j];       ans = (ans > temp) ? ans : temp;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k;   void search(int cur) {     int tot, c[10];     int ok;     if (cur == n)       tot++;     else       for (int i = 0; i < n; i++) {         ok = 1;         c[cur] = i;       }     for (int j = 0; j < cur; j++) {       if (c[cur] == c[j] || cur - c[cur] == j - c[j] ||           cur + c[cur] == j + c[j]) {         ok = 0;         break;       }     }     if (ok) search(cur + 1);   }   const long long MAXN = 55;   long long num[MAXN];   void xswl() {     scanf( %lld%lld , &n, &k);     for (long long i = 1; i <= n; ++i) {       scanf( %lld , &num[i]);     }     num[0] = 1;     sort(num + 1, num + 1 + n);     long long res = 999999999999999;     for (long long i = 2e5; i >= 0; --i) {       long long cnt = 0;       long long nowr = 0;       int t = lower_bound(num + 1, num + 1 + n, i) - num;       for (int j = t; j <= n; ++j) {         long long now = 0;         long long u = num[j];         while (u > i) {           ++now;           u >>= 1;         }         if (u == i) {           ++cnt;           nowr += now;         }         if (cnt == k) break;       }       if (cnt == k) {         if (res > nowr) {           res = nowr;         }       }     }     printf( %lld , res);   }   int main() { xswl(); }
#include <bits/stdc++.h>   using namespace std;   int maxn = 1000000000;   int main(int argc, char const *argv[]) {     int t;     cin >> t;     while (t--) {       int a, b;       cin >> a >> b;       if (a > b) a = a + b, b = a - b, a = a - b;       int side = max(2 * a, b);       cout << side * side << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(0);     int q;     cin >> q;     while (q--) {       int a, b, n, S;       cin >> a >> b >> n >> S;       int x = min(a, S / n);       cout << (S - x * n <= b ?  YES  :  NO ) <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int c[400000], t[400000], n, m, x[400000];   int main() {     scanf( %d%d , &n, &m);     int s = 0;     for (int i = 0; i < n; ++i) {       scanf( %d%d , &c[i], &t[i]);       s += c[i] * t[i];       x[i] = s;     }     while (m--) {       int a;       scanf( %d , &a);       printf( %d n , lower_bound(x, x + n, a) - x + 1);     }   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = (long long)1000000000000;   const double eps = (double)1e-8;   const int mod = (int)1000000007;   const int maxn = (int)1e6 + 5;   int n, res, cnt, z[maxn];   pair<pair<int, int>, pair<int, int> > a[maxn];   vector<int> t[maxn];   vector<pair<int, int> > vc[maxn];   map<int, int> m;   int sum(int z, int r) {     res = 0;     for (; r >= 0; r = (r & (r + 1)) - 1) res += t[z][r];     return res;   }   void upd(int z, int i, int delta) {     for (; i < (int)t[z].size(); i = (i | (i + 1))) t[z][i] += delta;     return;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     cin >> n;     cnt = 0;     for (int i = (1); i <= (n); i++) {       cin >> a[i].second.first >> a[i].first.first >> a[i].first.second;       a[i].second.second = i;       if (!m.count(a[i].first.second)) m[a[i].first.second] = ++cnt;       vc[m[a[i].first.second]].push_back(make_pair(a[i].first.first, i));     }     for (int i = (1); i <= (cnt); i++) {       sort(vc[i].begin(), vc[i].end());       for (int j = (0); j < (vc[i].size()); j++) {         z[vc[i][j].second] = j;         t[i].push_back(0);       }     }     for (int i = (1); i <= (n); i++) {       if (a[i].second.first == 1) {         upd(m[a[i].first.second], z[i], 1);       } else if (a[i].second.first == 2) {         upd(m[a[i].first.second], z[i], -1);       } else {         cout << sum(m[a[i].first.second], z[i]) <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char s[100004];   long long k, mod = 1000000007;   long long qpow(long long n, long long m) {     long long ans = 1;     for (; m; m >>= 1) {       if (m & 1) ans = ans * n % mod;       n = n * n % mod;     }     return ans;   }   int main() {     scanf( %s %lld , s, &k);     int l = strlen(s);     long long p = 0, q = 0;     for (int i = 0; i < l; i++)       if (s[i] ==  0  || s[i] ==  5 ) p = (p + qpow(2, i)) % mod;     q = (qpow(2, k * l) - 1) * qpow(qpow(2, l) - 1, mod - 2) % mod;     printf( %lld n , p * q % mod);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     vector<int> v(6);     for (int i = 0; i < 6; ++i) cin >> v[i];     int n;     cin >> n;     vector<pair<int, int>> a;     int num;     for (int i = 0; i < n; ++i) {       cin >> num;       for (int j = 0; j < 6; ++j) {         a.push_back({num - v[j], i});       }     }     sort(a.begin(), a.end());     int ans = 1e9 + 7;     map<int, int> mp;     int t = 0;     int l = 0;     for (int i = 0; i < a.size(); ++i) {       int k = a[i].second;       if (mp[k] == 0) {         t++;       }       mp[k]++;       while (mp[a[l].second] > 1) {         mp[a[l].second]--;         l++;       }       if (t == n) {         ans = min(ans, a[i].first - a[l].first);       }     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     char c;     unsigned int mask;     int u;     vector<unsigned int> ip;     set<unsigned int> net;     cin >> n >> k;     scanf( %c , &c);     unsigned int x, x1;     for (int i = 0; i < n; i++) {       c = 0;       x = 0;       x1 = 0;       while (c !=   n ) {         scanf( %c , &c);         if ((c !=  . ) && (c !=   n )) {           x *= 10;           x += (c -  0 );         } else {           x1 = x1 << 8;           x1 += x;           x = 0;         }       }       ip.push_back(x1);     }     for (int len = 1; len < 32; len++) {       mask = 1;       for (int y = 1; y < len; y++) {         mask = mask << 1;         mask++;       }       mask = mask << (32 - len);       unsigned int v = 0;       for (int i = 0; i < n; i++) {         v = ip[i];         v &= mask;         net.insert(v);       }       u = net.size();       if (u == k) {         unsigned int xx[4];         xx[3] = mask % 256;         mask /= 256;         xx[2] = mask % 256;         mask /= 256;         xx[1] = mask % 256;         mask /= 256;         xx[0] = mask;         cout << xx[0] <<  .  << xx[1] <<  .  << xx[2] <<  .  << xx[3] << endl;         return 0;       }       if (u > k) {         cout <<  -1  << endl;         return 0;       }       net.clear();     }     cout <<  -1  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double pi = acos(-1.0);   int t;   long long sufa[100010];   long long a[100010];   pair<long long, long long> ab[100010];   long long n, m;   int main() {     cin >> t;     while (t--) {       scanf( %lld %lld , &n, &m);       for (long long i = 0; i < m; i++) {         scanf( %lld %lld , &ab[i].first, &ab[i].second);       }       sort(ab, ab + m);       sufa[m] = 0;       sufa[m - 1] = a[m - 1] = ab[m - 1].first;       for (int i = m - 1 - 1; i >= 0; i--) {         a[i] = ab[i].first;         sufa[i] = sufa[i + 1] + a[i];       }       long long ans = 0;       if (n <= m) {         ans = sufa[m - n];       }       for (long long i = 0; i < m; i++) {         long long idx = lower_bound(a, a + m, ab[i].second) - a;         idx = max(idx, m - n);         long long costn = m - idx;         long long costa = 0;         if (idx > i && costn < n) {           costa = ab[i].first;           costn += 1;         }         ans = max(ans, sufa[idx] + costa + (n - costn) * ab[i].second);       }       printf( %lld n , ans);     }     return 0;   }
#include <bits/stdc++.h>   long long mpow(long long a, long long n, long long mod) {     long long ret = 1;     long long b = a;     while (n) {       if (n & 1) ret = (ret * b) % mod;       b = (b * b) % mod;       n >>= 1;     }     return (long long)ret;   }   using namespace std;   int a[100000 + 5];   map<int, int> ind;   long long cnt[1500];   long long dp[1400][1400];   long long fact[100000 + 5];   long long inv[100000 + 5];   void computefact() {     fact[0] = 1;     inv[0] = 1;     long long i, j;     for (j = 1; j < 100000 + 5; j++) {       fact[j] = (fact[j - 1] * j) % 1000000007;       inv[j] = mpow(fact[j], 1000000007 - 2, 1000000007);     }   }   long long ncr(long long n, long long r) {     long long den = (inv[r] * inv[n - r]) % 1000000007;     long long num = (fact[n] * den) % 1000000007;     return num;   }   bool chk(int x) {     while (x != 0) {       int p = x % 10;       if (!(p == 4 || p == 7)) {         return 0;       }       x /= 10;     }     return 1;   }   int main() {     int i, j;     vector<int> luck;     long long n, len;     cin >> n >> len;     long long unl = 0;     int c = 1;     computefact();     for (j = 0; j < n; j++) {       cin >> a[j];       if (chk(a[j])) {         if (!ind[a[j]]) {           luck.push_back(a[j]);           ind[a[j]] = c;           cnt[c]++;           c++;         } else {           cnt[ind[a[j]]]++;         }       } else         unl++;     }     dp[0][0] = 1;     int sz = luck.size();     for (i = 1; i <= sz; i++) {       for (j = 0; j <= sz; j++) {         dp[i][j] = (dp[i - 1][j] + (dp[i - 1][j - 1] * cnt[i]) % 1000000007) %                    1000000007;       }     }     long long ans = 0;     for (long long k = 0; k <= min(len, unl); k++) {       long long q = len - k;       if (q > sz) continue;       ans = (ans + (ncr(unl, k) * dp[sz][q]) % 1000000007) % 1000000007;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast,unroll-loops )   using namespace std;   mt19937 rng((int)std::chrono::steady_clock::now().time_since_epoch().count());   const int N = 1e5 + 3;   int ok[N], tsz[N], dep[N];   vector<int> adj[N], g[N];   multiset<int> mset[N];   int vis[N];   bool flag;   void dfs2(int u) {     vis[u] = 1;     for (auto v : adj[u]) {       if (vis[v] == 2) flag = false;       if (!vis[v]) dfs2(v);     }     vis[u] = 2;   }   void dfs(int u, int keep) {     vis[u] = 1;     int bigchild = -1, high = -1;     for (auto v : adj[u]) {       if (!vis[v] and tsz[v] > high) {         high = tsz[v];         bigchild = v;       }     }     multiset<int> backEdge;     for (auto v : adj[u]) {       if (!vis[v] and v != bigchild)         dfs(v, 0);       else if (vis[v] == 1)         backEdge.insert(v);     }     if (bigchild != -1) {       dfs(bigchild, 1);       swap(mset[u], mset[bigchild]);     }     for (auto x : backEdge) mset[u].insert(x);     for (auto v : adj[u]) {       if (v != bigchild) {         for (auto x : mset[v]) {           mset[u].insert(x);         }       }     }     mset[u].erase(u);     if (int(mset[u].size()) == 1) {       g[*mset[u].begin()].push_back(u);     }     vis[u] = 2;   }   bool interesting(int u) {     flag = true;     dfs2(u);     return flag;   }   void dfs4(int u) {     vis[u] = 1;     ok[u] = 1;     for (int v : g[u]) {       if (!vis[v]) dfs4(v);     }     vis[u] = 2;   }   int dfs3(int u, int d = 0) {     vis[u] = 1;     dep[u] = d;     for (auto v : adj[u]) {       if (!vis[v]) tsz[u] += dfs3(v, d + 1);     }     vis[u] = 2;     return tsz[u] + 1;   }   void solve() {     int n, m;     cin >> n >> m;     for (int i = 1; i <= n; ++i)       adj[i].clear(), tsz[i] = 0, mset[i].clear(), ok[i] = 0, g[i].clear();     for (int i = 0; i < m; ++i) {       int a, b;       cin >> a >> b;       adj[a].push_back(b);     }     int root = -1;     for (int t = 0; t < 100; ++t) {       int u = rng() % n + 1;       if (interesting(u)) {         root = u;       }       for (int i = 1; i <= n; ++i) vis[i] = 0;       if (root != -1) break;     }     if (root == -1) {       cout << -1 << endl;       return;     }     dfs3(root);     for (int i = 1; i <= n; ++i) vis[i] = 0;     dfs(root, 0);     for (int i = 1; i <= n; ++i) vis[i] = 0;     dfs4(root);     vector<int> ans;     for (int i = 1; i <= n; ++i)       if (ok[i]) ans.push_back(i);     if (5 * int(ans.size()) < n)       cout << -1 << endl;     else {       for (auto x : ans) cout << x <<    ;       cout << endl;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int vp, vd, t, f, c;     cin >> vp >> vd >> t >> f >> c;     int vs = vd - vp;     if (vp > vd) {       cout << 0;       return 0;     }     if (vp == vd) {       cout << 0;       return 0;     }     double d = vp * t;     d += d / (1.0 * vs) * vp;     cerr << d << endl;     if (int(d) >= c) {       cout << 0;       return 0;     }     int ans = 1;     while ((int)d < c) {       d += (d / vd + f) * vp;       d += (d / vs) * vp;       if (d - c > -1e-12) {         cout << ans;         return 0;       }       ans++;     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k, k1, k2, m;   int main() {     cin >> n >> k;     m = n;     while (m % 2 == 0) {       k1++;       m /= 2;     }     while (m % 5 == 0) {       k2++;       m /= 5;     }     for (int i = 1; i <= max(0ll, k - k1); ++i) {       n *= 2;     }     for (int i = 1; i <= max(0ll, k - k2); ++i) {       n *= 5;     }     cout << n;   }