#include <bits/stdc++.h>
using namespace std;
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e5 + 10;
long long c[maxn], u[maxn], tmp[maxn], n, k, mod = 1e15;
bool pos(long long cur) {
  priority_queue<pair<long long, long long> > pq;
  memset(tmp, 0, sizeof tmp);
  for (long long i = 0; i < n; i++) {
    pq.push({-(c[i] / u[i]), i});
  }
  for (long long i = 0; i < k; i++) {
    long long ind = pq.top().second;
    if (-pq.top().first < i) return false;
    pq.pop();
    if (pq.size() && -pq.top().first < i) return false;
    tmp[ind] += cur;
    if (tmp[ind] > 1e13) tmp[ind] = 1e13;
    long long t = tmp[ind] + c[ind] - ((long long)i + 1) * u[ind];
    if (t < 0) t = -1000000000;
    pq.push({-(i + t / u[ind] + 1), ind});
  }
  return true;
}
int main() {
  scanf("%lld%lld", &n, &k);
  for (long long i = 0; i < n; i++) scanf("%lld", &c[i]);
  for (long long i = 0; i < n; i++) scanf("%lld", &u[i]);
  long long l = 0, h = 1e13;
  while (l <= h) {
    long long mid = (l + h) / 2;
    if (pos(mid))
      h = mid - 1;
    else
      l = mid + 1;
  }
  if (h == 1e13)
    printf("-1\n");
  else
    printf("%lld\n", h + 1);
  return 0;
}
