#include <bits/stdc++.h>
using namespace std;
struct ps {
  long long a, b;
} p[200000 + 5];
long long cur[200000 + 5];
int n, k;
vector<int> v[200000 + 5];
priority_queue<pair<long long, int> > q;
bool check(long long x) {
  long long t;
  for (int i = 1; i <= n; i++) {
    cur[i] = p[i].a;
    t = cur[i] / p[i].b + 1;
    if (t >= k) continue;
    v[t].push_back(i);
  }
  int last = 1;
  bool flag = 1;
  for (int i = 1; i < k; i++) {
    for (int j = 0; j < v[i].size() && flag; j++) {
      int pos = v[i][j];
      cur[pos] += x;
      t = cur[pos] / p[pos].b + 1;
      if (last > i || last > t)
        flag = 0;
      else
        last++;
      if (t >= k) continue;
      v[t].push_back(pos);
    }
    v[i].clear();
  }
  return flag;
}
int main() {
  long long l = 0, r = 0;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%I64d", &p[i].a);
  for (int i = 1; i <= n; i++) scanf("%I64d", &p[i].b);
  r = 2e12;
  while (l < r) {
    long long mid = l + r >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (!check(l))
    puts("-1");
  else
    printf("%I64d\n", l);
  return 0;
}
