malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int test, a, sum = 0, wait = 0, counter = 0;     priority_queue<int, vector<int>, greater<int> > q;     queue<int> qqq;     cin >> test;     int num = test;     while (test--) {       cin >> a;       sum += a;       q.push(a);       qqq.push(a);     }     while (!q.empty()) {       int serve = q.top();       if (serve >= wait)         counter++;       else {         q.pop();         continue;       }       wait += serve;       q.pop();     }     cout << counter << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 3010;   const int M = 11;   const int INF = 1 << 30;   const double EPS = 1e-8;   const int MOD = 1000000007LL;   int n, tot[N];   vector<int> edge[N], edge2[N];   int dfs(int u, int fa) {     int num = 0, sz;     sz = edge[u].size();     for (int i = 0; i < sz; i++) {       int v = edge[u][i];       if (v == fa) {         continue;       }       num += dfs(v, u);     }     sz = edge2[u].size();     for (int i = 0; i < sz; i++) {       int v = edge2[u][i];       if (v == fa) {         continue;       }       num += dfs(v, u) + 1;     }     return num;   }   void init() {     memset(tot, 0, sizeof(tot));     for (int i = 0; i < n; i++) {       edge[i].clear();       edge2[i].clear();     }     for (int i = 1; i < n; i++) {       int u, v;       scanf( %d %d , &u, &v);       u--, v--;       edge[u].push_back(v);       edge2[v].push_back(u);     }     for (int u = 0; u < n; u++) {       int sz;       sz = edge[u].size();       for (int i = 0; i < sz; i++) {         int v = edge[u][i];         int num = dfs(v, u);         tot[u] += num;       }       sz = edge2[u].size();       for (int i = 0; i < sz; i++) {         int v = edge2[u][i];         int num = dfs(v, u) + 1;         tot[u] += num;       }     }   }   int dfs2(int u, int fa) {     int sz, ret = tot[u];     sz = edge[u].size();     for (int i = 0; i < sz; i++) {       int v = edge[u][i];       if (v == fa) {         continue;       }       ret = min(ret, dfs2(v, u));     }     sz = edge2[u].size();     for (int i = 0; i < sz; i++) {       int v = edge2[u][i];       if (v == fa) {         continue;       }       ret = min(ret, dfs2(v, u));     }     return ret;   }   void solve() {     int ans = INF;     for (int i = 0; i < n; i++) {       ans = min(ans, tot[i]);     }     for (int i = 0; i < n; i++) {       vector<int> p;       int sz;       sz = edge[i].size();       for (int j = 0; j < sz; j++) {         int v = edge[i][j];         p.push_back(dfs2(v, i));       }       sz = edge2[i].size();       for (int j = 0; j < sz; j++) {         int v = edge2[i][j];         p.push_back(dfs2(v, i));       }       if (p.size() <= 1) {         continue;       }       sort(p.begin(), p.end());       int tmp = p[0] + p[1] - tot[i];       ans = min(ans, tmp);     }     cout << ans << endl;   }   int main() {     while (cin >> n) {       init();       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   #define rep(i,a,b) for(int i = (a); i < b; ++i)   #define rrep(i,a,b) for(int i = (b); i --> (a);)   #define trav(x, v) for(auto &x : v)   #define all(v) (v).begin(),(v).end()   #define sz(v) (int)(v).size()      bool que_big(int s, string x){    cout << s+1 <<     << x << endl;    string res;    cin >> res;    return res ==  yes ;   }      int main(){    int n = 200, b = 200;    cin >> n >> b;       vector<string> ub(n, string(b,  1 ));    string lb(b,  0 );    deque<int> ko;    rep(i,0,n) ko.push_back(i);    string nxt = string(b,  1 );    nxt[0] =  0 ;    while(true){     int s = ko.front();     if(ub[s] < lb){      ko.pop_front();      continue;     }     if(ub[s] == lb){      cout << 0 <<     << lb << endl;      return 0;     }     if(que_big(s, nxt)){      lb = nxt;      rrep(i,0,b){       if(lb[i]== 0 ){        lb[i] =  1 ;        nxt[i] =  1 ;        break;       } else {        lb[i] =  0 ;       }      }     } else {      ub[s] = nxt;      ko.pop_front();      ko.push_back(s);      rep(i,0,b) if(nxt[i] > lb[i]){       nxt[i] =  0 ;       break;      }     }    }   }
#include <bits/stdc++.h>   inline long long read() {     long long x = 0, f = 1;     char c = getchar();     for (; c >  9  || c <  0 ; c = getchar()) {       if (c ==  - ) f = -1;     }     for (; c >=  0  && c <=  9 ; c = getchar()) {       x = x * 10 + c -  0 ;     }     return x * f;   }   int dp[18][(1 << 18)][2][2];   bool fan[200005];   inline void work() {     int n = read(), k = read();     for (int i = 1; i <= k; i++) {       int x = read();       fan[x] = 1;     }     memset(dp, -0x3f, sizeof dp);     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= (1 << n); j += (1 << i)) {         if (i == 1) {           dp[i][j][fan[j]][fan[j + 1]] = (fan[j] | fan[j + 1]);           dp[i][j][fan[j + 1]][fan[j]] = (fan[j] | fan[j + 1]);         } else {           for (int x1 = 0; x1 < 2; x1++) {             for (int x2 = 0; x2 < 2; x2++) {               for (int y1 = 0; y1 < 2; y1++) {                 for (int y2 = 0; y2 < 2; y2++) {                   int tmp =                       dp[i - 1][j][x1][y1] + dp[i - 1][j + (1 << i - 1)][x2][y2];                   if (x1 | x2) tmp++;                   if (y1 | y2) tmp++;                   dp[i][j][x1][x2] = std::max(dp[i][j][x1][x2], tmp + (x2 | y1));                   dp[i][j][x1][x2] = std::max(dp[i][j][x1][x2], tmp + (x2 | y2));                   dp[i][j][x1][y1] = std::max(dp[i][j][x1][y1], tmp + (y1 | x2));                   dp[i][j][x1][y2] = std::max(dp[i][j][x1][y2], tmp + (y2 | x2));                   dp[i][j][x2][x1] = std::max(dp[i][j][x2][x1], tmp + (x1 | y1));                   dp[i][j][x2][x1] = std::max(dp[i][j][x2][x1], tmp + (x1 | y2));                   dp[i][j][x2][y1] = std::max(dp[i][j][x2][y1], tmp + (y1 | x1));                   dp[i][j][x2][y2] = std::max(dp[i][j][x2][y2], tmp + (y2 | x1));                 }               }             }           }         }       }     }     int ans = -0x3f3f3f3f;     ans = std::max(ans, dp[n][1][1][1] + 1);     ans = std::max(ans, dp[n][1][0][1] + 1);     ans = std::max(ans, dp[n][1][1][0] + 1);     ans = std::max(ans, dp[n][1][0][0]);     printf( %d n , ans);   }   int main() {     work();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int con = 0;   vector<pair<long long int, long long int> > v;   long long int t[5000][5001];   vector<vector<pair<long long int, long long int> > > ans(5001);   bool istrue[5001];   vector<long long int> a[5001];   long long int dis[5001];   int n;   int ppp = 0;   queue<int> q;   void bfs(int src) {     q.push(src);     istrue[src] = true;     dis[src] = 0;     while (!q.empty()) {       int p = q.front();       q.pop();       ans[con].push_back({(dis[p] + 1) % 2, p});       for (auto u : a[p]) {         if (!istrue[u]) {           dis[u] = dis[p] + 1;           if (dis[u] % 2)             v[con].second++;           else             v[con].first++;           istrue[u] = true;           q.push(u);         } else {           if (dis[u] % 2 == dis[p] % 2) {             cout <<  NO                   <<   n ;             ppp = 1;             return;           }         }       }     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int tt = 1;     while (tt--) {       long long int m;       cin >> n >> m;       long long int n1, n2, n3;       cin >> n1 >> n2 >> n3;       for (int i = 0; i < m; i++) {         int x, y;         cin >> x >> y;         a[x].push_back(y);         a[y].push_back(x);       }       for (int i = 1; i <= n; i++) {         if (!istrue[i]) {           v.push_back({1, 0});           bfs(i);           con++;         }         if (ppp == 1) return 0;       }       memset(t, -1, sizeof(t));       if (v[0].first <= n2) t[0][v[0].first] = 0;       if (v[0].second <= n2) t[0][v[0].second] = 0;       for (int i = 1; i <= (long long int)v.size() - 1; i++) {         for (int j = 0; j < n2 + 1; j++) {           long long int vv = j - v[i].first;           if (vv >= 0 && t[i - 1][vv] != -1) t[i][j] = vv;           vv = j - v[i].second;           if (vv >= 0 && t[i - 1][vv] != -1) t[i][j] = vv;         }       }       char ss[n + 1];       if (t[(long long int)v.size() - 1][n2] == -1)         cout <<  NO               <<   n ;       else {         cout <<  YES               <<   n ;         long long int i = (long long int)v.size() - 1, ind = n2;         while (i != -1) {           long long int pp = ind - t[i][ind], kk = 0;           if (v[i].first == pp) kk = 1;           for (auto u : ans[i]) {             if (u.first == kk)               ss[u.second] =  2 ;             else               ss[u.second] =  1 ;           }           ind = t[i][ind];           i--;         }         for (int j = 1; j <= n; j++) {           if (ss[j] ==  1 ) {             if (n1 == 0)               ss[j] =  3 ;             else               n1--;           }           cout << ss[j];         }         cout <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n, m;     cin >> n >> m;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < m; ++j) {         int k;         cin >> k;         if (k % 2 != (i + j) % 2) k++;         cout << k <<    ;       }       cout << endl;     }   }   int main() {     int n;     cin >> n;     while (n--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MXN = 5e4 + 5;   const int INF = 1e9;   const long long P = 29;   const long long MOD = 1e9 + 7;   int t;   int main() {     srand(time(0));     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cout << fixed << setprecision(10);     cin >> t;     while (t--) {       int n, x1, x2, x3;       cin >> n;       cin >> x1 >> x2;       for (int i = 2; i < n; i++) {         cin >> x3;       }       if (x1 + x2 <= x3)         cout << 1 <<     << 2 <<     << n <<   n ;       else         cout << -1 <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int read() {     int x = 0, flag = 1;     char c = getchar();     while ((c >  9  || c <  0 ) && c !=  - ) c = getchar();     if (c ==  - ) flag = 0, c = getchar();     while (c <=  9  && c >=  0 ) {       x = (x << 3) + (x << 1) + c -  0 ;       c = getchar();     }     return flag ? x : -x;   }   const int maxn = 2005;   int f[maxn][maxn];   char s[maxn][maxn];   int main() {     int n = read(), m = read();     for (int i = (1); i <= (int)(n); i++) scanf( %s , s[i] + 1);     for (int i = (1); i <= (int)(2); i++)       for (int j = (1); j <= (int)(m); j++) f[i][j] = 1;     for (int i = (3); i <= (int)(n); i++)       for (int j = (1); j <= (int)(m); j++) {         if (j == 1 || j == m) {           f[i][j] = 1;           continue;         }         if (s[i][j] != s[i - 1][j - 1] || s[i][j] != s[i - 1][j] ||             s[i][j] != s[i - 1][j + 1] || s[i][j] != s[i - 2][j]) {           f[i][j] = 1;           continue;         }         int x = 100000;         x = min(x, f[i - 1][j - 1]);         x = min(x, f[i - 1][j]);         x = min(x, f[i - 1][j + 1]);         x = min(x, f[i - 2][j]);         f[i][j] = x + 1;       }     long long ans = 0;     for (int i = (1); i <= (int)(n); i++)       for (int j = (1); j <= (int)(m); j++) ans += f[i][j];     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename S, typename T>   ostream& operator<<(ostream& out, pair<S, T> const& p) {     out <<  (  << p.first <<  ,   << p.second <<  ) ;     return out;   }   template <typename T>   ostream& operator<<(ostream& out, vector<T> const& v) {     long long l = v.size();     for (long long i = 0; i < l - 1; i++) out << v[i] <<    ;     if (l > 0) out << v[l - 1];     return out;   }   template <typename T>   void trace(const char* name, T&& arg1) {     cout << name <<   :   << arg1 <<   n ;   }   template <typename T, typename... Args>   void trace(const char* names, T&& arg1, Args&&... args) {     const char* comma = strchr(names + 1,  , );     cout.write(names, comma - names) <<   :   << arg1 <<   |  ;     trace(comma + 1, args...);   }   const long long N = 3e5 + 100;   long long MOD;   long long power(long long x, long long t) {     long long ans = 1;     while (t > 0) {       if (t & 1) ans = 1LL * ans * x % MOD;       x = 1LL * x * x % MOD;       t >>= 1;     }     return ans;   }   inline long long sub(long long a, long long b) {     a %= MOD;     b %= MOD;     a = ((a - b) % MOD + MOD) % MOD;     return a;   }   inline long long add(long long a, long long b) {     a %= MOD;     b %= MOD;     a = (a + b) % MOD;     return a;   }   inline long long mul(long long a, long long b) {     a %= MOD;     b %= MOD;     a = (a * b) % MOD;     return a;   }   inline long long inv(long long a) {     a = a % MOD;     a = power(a, MOD - 2);     return a;   }   long long a[N], n, k;   map<long long, long long> cnt;   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n >> MOD >> k;     for (long long i = 1; i <= n; i++) {       long long temp;       cin >> temp;       long long kk = power(temp, 4);       long long k2 = mul(k, temp);       kk = sub(kk, k2);       cnt[kk]++;     }     long long ans = 0;     auto c2 = [](long long a) -> long long { return ((a * (a - 1)) / 2); };     for (auto i : cnt) {       ans += c2(i.second);     }     cout << ans <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 200000 + 10;   const long long INF = 2e9 + 10;   long long dic[N], idx[N];   int main() {     long long n, k, ii;     scanf( %lld%lld , &n, &k);     for (long long i = 0; i <= n; ++i) scanf( %lld , idx + i), dic[i] = idx[i];     for (long long i = 1; i <= n + 1; ++i)       dic[i] += dic[i - 1] / 2, dic[i - 1] %= 2;     for (long long i = 0; i <= n + 1; ++i) {       if (dic[i]) {         ii = i;         break;       }     }     long long x = 0, ans = 0;     for (long long i = n + 1; i >= 0; --i) {       x = x * 2 + dic[i];       if (abs(x) > INF) break;       if (i > ii || i == n + 1 || (i == n && x == idx[i])) continue;       if (abs(x - idx[i]) <= k) ++ans;     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool sortmahstyle(const pair<int, int> &a, const pair<int, int> &b) {     if (a.first < b.first) return true;     return false;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int n, m;     cin >> n >> m;     long long int hash[n + 1], col[4];     memset(hash, 0, sizeof(hash));     while (m--) {       memset(col, 0, sizeof(col));       long long int inp[3];       for (long long int i = 0; i < 3; i++) {         cin >> inp[i];         col[hash[inp[i]]] = 1;       }       for (long long int i = 0; i < 3; i++) {         long long int x = inp[i];         if (hash[x] == 0) {           for (long long int j = 1; j < 4; j++) {             if (col[j] == 0) {               hash[x] = j;               col[hash[x]] = 1;               break;             }           }         } else {           col[hash[x]] = 1;         }       }     }     for (long long int i = 1; i < n + 1; i++) cout << hash[i] <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     vector<long long int> a(n), b(n);     set<long long int> s;     for (int i = 0; i < n; i++) {       cin >> a[i];       s.insert(a[i]);     }     for (int i = 0; i < n; i++) {       cin >> b[i];       s.insert(b[i]);     }     long long int count = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         long long int temp = a[i] ^ b[j];         if (s.find(temp) != s.end()) count++;       }     }     if (count % 2 != 0)       cout <<  Koyomi  << endl;     else       cout <<  Karen  << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long a[100010];   int main() {     long long n, pos;     while (cin >> n >> pos) {       for (long long i = 0; i < n; i++) scanf( %I64d , &a[i]);       sort(a, a + n);       long long res1 = 0, res2, res;       if (pos < a[0])         res1 = a[n - 2] - pos;       else if (a[0] <= pos && pos <= a[n - 2])         res1 = min((pos - a[0]) * 2 + a[n - 2] - pos,                    (a[n - 2] - pos) * 2 + pos - a[0]);       else if (pos > a[n - 2])         res1 = pos - a[0];       if (pos < a[1])         res2 = a[n - 1] - pos;       else if (a[1] <= pos && pos <= a[n - 1])         res2 = min((pos - a[1]) * 2 + a[n - 1] - pos,                    (a[n - 1] - pos) * 2 + pos - a[1]);       else if (pos > a[n - 1])         res2 = pos - a[1];       res = min(res1, res2);       if (n == 1) res = 0;       printf( %I64d n , res);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 100010;   const int M = 310;   int n, m, s, e0, E;   pair<int, int> dp[N][M];   int a[N];   vector<int> elAtB[N];   inline int findj(int j0, int val) {     if (j0 >= m) return -1;     vector<int> &v = elAtB[val];     if (v.size() == 0) return -1;     vector<int>::iterator it = lower_bound(v.begin(), v.end(), j0);     if (it == v.end())       return -1;     else       return *it;   }   int main() {     cin >> n >> m >> s >> e0;     E = s / e0;     int ost = s - E * e0;     for (int i = 0; i < n; i++) {       cin >> a[i];     }     for (int j = 0; j < m; j++) {       int x;       cin >> x;       elAtB[x].push_back(j);     }     int ans = 0;     for (int i = 0; i <= n; i++) {       for (int e = 0; e <= E; e++) {         dp[i][e] = make_pair(0, 0);       }     }     for (int i = 0; i < n; i++) {       for (int e = 1; e <= E; e++) {         int dol = dp[i][e].first;         int j0 = dp[i][e].second;         int dolnxt = dp[i + 1][e].first;         if (dol > dolnxt) {           dp[i + 1][e] = make_pair(dol, j0);         }         int j = findj(j0, a[i]);         if (j == -1)           continue;         else {         }         dolnxt = dp[i + 1][e - 1].first;         int jnxt = dp[i + 1][e - 1].second;         if (((dol + 1 > dolnxt) || (dol + 1 == dolnxt && j < jnxt)) &&             ((i + 1 + j + 1) <= (e - 1) * e0 + ost)) {           dp[i + 1][e - 1] = make_pair(dol + 1, j + 1);           ans = max(ans, dol + 1);         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   int main() {     int i, j, k, n;     scanf( %d , &n);     k = sqrt(n);     for (i = k; i >= 1; i--) {       if (n % i == 0) {         j = i;         break;       }     }     printf( %d %d , j, (n / j));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 100005;   long long n, d, b;   long long a[maxn];   bool f(long long x) {     long long l = 1 + x;     long long r = n - x;     deque<pair<long long, long long>> dq;     for (long long i = 1; i <= n; i++)       if (a[i] != 0) dq.push_front({i, a[i]});     long long t = 1 + x;     while (l <= r) {       long long left = b;       while (left > 0) {         if (dq.empty()) return false;         pair<long long, long long> p = dq.back();         dq.pop_back();         long long amt = min(p.second, left);         if (p.first - l > t * d) return false;         p.second -= amt;         left -= amt;         if (p.second > 0) dq.push_back(p);       }       l++;       if (l <= r) {         long long right = b;         while (right > 0) {           if (dq.empty()) return false;           pair<long long, long long> p = dq.front();           dq.pop_front();           long long amt = min(p.second, right);           if (r - p.first > t * d) return false;           p.second -= amt;           right -= amt;           if (p.second > 0) dq.push_front(p);         }         r--;       }       t++;     }     return true;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n >> d >> b;     for (long long i = 1; i <= n; i++) cin >> a[i];     long long l = 0;     long long r = n;     while (r - l > 3) {       long long mid = (r - l) / 2 + l;       if (f(mid))         r = mid;       else         l = mid;     }     for (long long i = l; i <= r; i++) {       if (f(i)) {         cout << i <<   n ;         break;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int iinf = 1e9 + 10;   const long long inf = 1ll << 60;   const long long mod = 1e9 + 7;   void GG() {     cout <<  0 n ;     exit(0);   }   long long mpow(long long a, long long n, long long mo = mod) {     long long re = 1;     while (n > 0) {       if (n & 1) re = re * a % mo;       a = a * a % mo;       n >>= 1;     }     return re;   }   long long inv(long long b, long long mo = mod) {     if (b == 1) return b;     return (mo - mo / b) * inv(mo % b, mo) % mo;   }   const int maxn = 1e6 + 5;   long long dp[2003][22];   long long fac[200006], ifac[200006];   inline long long CC(int a, int b) {     a = a + b;     return fac[a] * ifac[b] % mod * ifac[a - b] % mod;   }   int R[2003], C[2003];   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     ;     fac[0] = ifac[0] = 1;     for (int i = 1; i <= 200006; ++i) {       fac[i] = fac[i - 1] * i % mod;       ifac[i] = inv(fac[i]);     }     int n, m, k, second;     cin >> n >> m >> k >> second;     vector<pair<int, int> > v;     v.push_back({1, 1});     v.push_back({n, m});     for (int i = 0; i < k; ++i) {       int r, c;       cin >> r >> c;       v.push_back({r, c});     }     sort(v.begin(), v.end());     for (int i = 1; i <= (int)v.size() - 1; ++i) {       R[i] = v[i].first, C[i] = v[i].second;       dp[i][0] = CC(R[i] - 1, C[i] - 1);       for (int fk = 0; fk < 21; ++fk) {         for (int j = 1; j <= i - 1; ++j) {           if (R[j] <= R[i] && C[j] <= C[i]) {             dp[i][fk] -= dp[j][fk] * CC(R[i] - R[j], C[i] - C[j]) % mod;             if (dp[i][fk] < 0) dp[i][fk] += mod;             dp[i][fk + 1] += dp[j][fk] * CC(R[i] - R[j], C[i] - C[j]) % mod;             if (dp[i][fk + 1] >= mod) dp[i][fk + 1] -= mod;           }         }       }     }     long long re = 0;     for (int fk = 0; fk < 22; ++fk) {       re += dp[(int)v.size() - 1][fk] * second % mod;       second = (second + 1) / 2;     }     cout << re * inv(CC(n - 1, m - 1)) % mod <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   struct lem {     long long m;     long long v;     int id;     bool operator<(const lem& other) const {       if (m > other.m) return true;       if (m < other.m) return false;       if (v > other.v) return true;       if (v < other.v) return false;       return id > other.id;     }   };   int N, K, H;   lem L[100010];   int asst[100010];   int tempa[100010];   bool solve(long double t) {     memset(tempa, 0, sizeof(tempa));     int start = 0;     for (int k = K; k >= 1; k--) {       bool found = false;       for (int i = (start); i <= (N - 1); i++) {         long double time =             ((long double)k) / ((long double)L[i].v) * ((long double)H);         if (time <= t) {           found = true;           tempa[k] = i;           start = i + 1;           break;         }       }       if (!found) return false;     }     return true;   }   int main() {     cin >> N >> K >> H;     for (int i = 0; i < N; i++) cin >> L[i].m;     for (int i = 0; i < N; i++) cin >> L[i].v;     for (int i = 0; i < N; i++) L[i].id = i + 1;     sort(L, L + N);     long double low = 0.l;     long double high = 1000000000.l;     int times = 100;     while (times--) {       long double t = (low + high) / 2.l;       if (solve(t)) {         for (int i = (1); i <= (K); i++) asst[i] = tempa[i];         high = t;       } else {         low = t;       }     }     for (int k = (1); k <= (K); k++) {       if (k > 1) cout <<    ;       cout << L[asst[k]].id;     }     cout << endl;   }