#include <bits/stdc++.h>
using namespace std;
const int N = 220000;
long long a[N], b[N];
int rt[N], n, k;
int find_root(int u) {
  if (u == rt[u]) return u;
  return rt[u] = find_root(rt[u]);
}
bool can(long long x) {
  for (int i = 0; i <= k; i++) rt[i] = i;
  for (int i = 1; i <= n; i++) {
    long long now = a[i];
    while (b[i] * k > now) {
      long long u = now / b[i] + 1;
      u = find_root(u);
      if (u == 0) return 0;
      rt[u] = u - 1;
      now += x;
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  k--;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  long long st = 0, en = 1e14;
  if (!can(en)) return puts("-1"), 0;
  if (can(st)) return puts("0"), 0;
  while (en - st > 1) {
    long long mid = (st + en) / 2;
    if (can(mid))
      en = mid;
    else
      st = mid;
  }
  cout << en << endl;
  return 0;
}
