#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const static int n_max = 200000;
int n;
ll a[n_max], b[n_max], k;
int last_charged[n_max];
bool IsEnough(ll power) {
  priority_queue<pair<ll, int>, vector<pair<ll, int> >,
                 greater<pair<ll, int> > >
      pq;
  ll a_[n];
  for (int i = 0; i < n; ++i) {
    a_[i] = a[i];
    pq.push(make_pair(a_[i] / b[i] + 1, i));
    last_charged[i] = 0;
  }
  int time = 0;
  while (pq.top().first < k) {
    if (pq.top().first <= time) return false;
    int id = pq.top().second;
    pq.pop();
    (a_[id] -= b[id] * (++time - last_charged[id])) += power;
    last_charged[id] = time;
    pq.push(make_pair(
        (a_[id] >= 0 ? a_[id] / b[id] : ((-1 - a_[id]) / b[id] * (-1) - 1)) +
            time + 1,
        id));
  }
  return true;
}
int main() {
  scanf("%d %lld", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%lld", a + i);
  for (int i = 0; i < n; ++i) scanf("%lld", b + i);
  ll ok = 2000000000000;
  ll ng = 0;
  if (!IsEnough(ok)) {
    printf("-1\n");
    return 0;
  }
  if (IsEnough(ng)) {
    printf("0\n");
    return 0;
  }
  while (abs(ng - ok) > 1) {
    ll mid = ok + ng >> 1;
    if (IsEnough(mid))
      ok = mid;
    else
      ng = mid;
  }
  printf("%lld\n", ok);
  return 0;
}
