#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, k, c[N];
long long a[N], b[N];
inline bool check(long long mid) {
  for (int i = 1; i <= n; i++) c[i] = 0;
  priority_queue<pair<long long, int>, vector<pair<long long, int> >,
                 greater<pair<long long, int> > >
      que;
  for (int i = 1; i <= n; i++) {
    que.push(make_pair(a[i] / b[i] + 1, i));
  }
  for (int i = 1; i <= k; i++) {
    pair<long long, int> p = que.top();
    que.pop();
    if (p.first > k) return true;
    if (p.first < i) return false;
    c[p.second]++;
    que.push(make_pair((a[p.second] + mid * c[p.second]) / b[p.second] + 1,
                       p.second));
  }
  return true;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%I64d", &b[i]);
  long long lo = 0, hi = 2e12;
  while (lo < hi) {
    long long mid = (lo + hi) >> 1;
    if (check(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (!check(hi)) hi = -1;
  cout << hi << endl;
  return 0;
}
