#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 100100, MAXK = 2 * 100100;
int n, k, b[MAXN];
long long a[MAXN], aux[MAXN], ans;
bool ok(long long x) {
  priority_queue<pair<long long, int>> q;
  for (int i = 1; i <= n; ++i)
    q.push(make_pair(-a[i] / b[i], i)), aux[i] = a[i];
  pair<long long, int> cur;
  for (int i = 0; i < k; ++i) {
    cur = q.top(), q.pop();
    if (i > aux[cur.second] / b[cur.second]) return false;
    cur.first = -(aux[cur.second] += x) / b[cur.second];
    q.push(cur);
  }
  return true;
}
long long bs() {
  long long beg = 0, end = 2e12, mid;
  while (beg < end) {
    mid = (beg + end) >> 1;
    if (ok(mid))
      end = mid;
    else
      beg = mid + 1;
  }
  return end;
}
int main() {
  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]);
  printf("%lld\n", (ok(ans = bs()) ? ans : -1LL));
}
