#include <bits/stdc++.h>
using namespace std;
const long long M = 200005;
long long read() {
  long long x = 0, f = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9') {
    if (c == '-') f = -1;
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
long long n, k, ans = -1, a[M], b[M];
struct node {
  long long a, b, c;
  bool operator<(const node &r) const { return c > r.c; }
};
long long check(long long x) {
  priority_queue<node> q;
  for (long long i = 1; i <= n; i++) q.push(node{a[i], b[i], a[i] / b[i]});
  for (long long i = 0; i < k; i++) {
    if (q.empty()) return 1;
    node t = q.top();
    q.pop();
    if (t.c < i) return 0;
    if ((t.a + x) / t.b <= k) q.push(node{t.a + x, t.b, (t.a + x) / t.b});
  }
  return 1;
}
void dich(long long l, long long r) {
  if (l > r) return;
  long long mid = (l + r) >> 1;
  if (check(mid)) {
    ans = mid;
    dich(l, mid - 1);
  } else
    dich(mid + 1, r);
}
signed main() {
  n = read();
  k = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  for (long long i = 1; i <= n; i++) b[i] = read();
  dich(0, 2e12);
  printf("%lld\n", ans);
}
