func_code_string: #include <bits/stdc++.h>   using namespace std;   void read(int &val) {     int x = 0;     int bz = 1;     char c;     for (c = getchar(); (c <  0  || c >  9 ) && c !=  - ; c = getchar())       ;     if (c ==  - ) {       bz = -1;       c = getchar();     }     for (; c >=  0  && c <=  9 ; c = getchar()) x = x * 10 + c - 48;     val = x * bz;   }   const int INF = 0x3f3f3f3f;   const int maxn = 1e6 + 100;   const int mod = 998244353;   long long a[maxn], b[maxn];   int n, k;   long long sum[maxn], tim[maxn];   struct node {     int id;     bool operator<(const node bb) const { return tim[id] > tim[bb.id]; }   };   bool check(long long mid) {     priority_queue<node> q;     for (int i = 1; i <= n; i++) {       tim[i] = a[i] / b[i];       sum[i] = a[i];       q.push(node{i});     }     for (int i = 0; i <= k - 1; i++) {       node top = q.top();       q.pop();       int xx = top.id;       if (tim[xx] < i) return false;       if (tim[xx] >= k) return true;       sum[xx] += mid;       tim[xx] = sum[xx] / b[xx];       if (tim[xx] < i) return false;       q.push(node{xx});     }     return true;   }   int main() {     read(n);     read(k);     for (int i = 1; i <= n; i++) scanf( %lld , &a[i]);     for (int i = 1; i <= n; i++) scanf( %lld , &b[i]);     long long ans = -1, l = 0, r = 1e13;     while (l <= r) {       long long mid = l + r >> 1;       if (check(mid)) {         ans = mid;         r = mid - 1;       } else         l = mid + 1;     }     printf( %lld n , ans);     return 0;   }   