#include <bits/stdc++.h>
using namespace std;
int n;
long long k, a[200005], b[200005];
struct node {
  long long a, b, k;
  node() {}
  node(long long _a, long long _b, long long _k) { a = _a, b = _b, k = _k; }
  bool operator<(node c) const { return k > c.k; }
};
priority_queue<node> q;
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]));
  }
  if (q.empty()) return 1;
  for (int i = 0; i < k; ++i) {
    node now = q.top();
    q.pop();
    if (now.k < i) return 0;
    if ((now.a + x) / now.b < k)
      q.push(node(now.a + x, now.b, (now.a + x) / now.b));
    if (q.empty()) return 1;
  }
  return 1;
}
int main() {
  long long Max = 0;
  scanf("%d%lld", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &b[i]);
    Max = max(Max, b[i]);
  }
  long long l = 0, r = Max * k, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
