#include <bits/stdc++.h>
using namespace std;
long long n, k;
struct node {
  long long a, b;
  node(long long a = 0, long long b = 0) : a(a), b(b) {}
  bool operator<(const node& a1) const {
    return double(a / b) < double(a1.a / a1.b);
  }
};
long long a[200005], b[200005];
vector<node> v[200005];
bool check(long long x) {
  long long i, j;
  for (i = 1; i <= k; i++) v[i].clear();
  for (i = 1; i <= n; i++) {
    long long tmp = a[i] / b[i] + 1;
    if (tmp < k) v[tmp].push_back(node(a[i], b[i]));
  }
  long long p, now;
  for (now = 0, p = 0; now < k; now++) {
    while (p < k && v[p].size() == 0) p++;
    if (p >= k) return true;
    if (p < now) return false;
    node tmp = v[p].back();
    v[p].pop_back();
    long long what_the_hell = tmp.a / tmp.b + 1;
    if (what_the_hell <= now) return false;
    tmp.a += x;
    what_the_hell = tmp.a / tmp.b + 1;
    if (what_the_hell <= now + 1) return false;
    if (what_the_hell < k) v[what_the_hell].push_back(tmp);
  }
  return true;
}
int main() {
  long long i, j;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  long long l = 0, r = 2e13, mid;
  if (!check(r)) {
    cout << "-1" << endl;
    return 0;
  }
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << r << endl;
  return 0;
}
