#include <bits/stdc++.h>
const long long inf = 2e12;
using namespace std;
struct node {
  long long x, y, z;
  node(){};
  node(long long X, long long Y, long long Z) { x = X, y = Y, z = Z; }
  bool operator<(const node &rhs) const { return z > rhs.z; }
};
int n, k;
long long a[200005], b[200005], ans = -1;
priority_queue<node> Q;
long long read() {
  long long x = 0;
  int f = 1;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
bool check(long long x) {
  while (!Q.empty()) Q.pop();
  for (int i = 1; i <= n; i++) {
    if (a[i] / b[i] < k) Q.push(node(a[i], b[i], a[i] / b[i]));
  }
  for (int i = 0; i < k; i++) {
    if (Q.empty()) return 1;
    node p = Q.top();
    Q.pop();
    if (p.z >= k) return 1;
    if (p.z < i) return 0;
    if ((p.x + x) / p.y < k) Q.push(node(p.x + x, p.y, (p.x + x) / p.y));
  }
  return 1;
}
int main() {
  n = read(), k = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) b[i] = read();
  long long l = 0, r = inf;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%lld\n", ans);
}
