#include <bits/stdc++.h>
using namespace std;
int n, k;
long long a[200005], b[200005];
int cnt[200005];
bool check(long long x) {
  memset(cnt, 0, sizeof(cnt));
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    if (b[i] == 0) continue;
    long long sum = a[i];
    while (sum / b[i] + 1 < k) {
      cnt[sum / b[i] + 1]++;
      sum += x;
      tot++;
      if (tot > k) return false;
    }
  }
  for (int i = 1; i <= k; i++) {
    cnt[i] += cnt[i - 1];
    if (cnt[i] > i) return false;
  }
  return true;
}
int main() {
  while (~scanf("%d %d", &n, &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 l = 0, r = 1e13, ans = -1;
    while (l <= r) {
      long long mid = l + r >> 1;
      if (check(mid)) {
        r = mid - 1;
        ans = mid;
      } else
        l = mid + 1;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
