#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 7;
int n, k;
long long a[MAXN], b[MAXN];
struct node {
  long long a, b, c;
  bool operator<(const node &rhs) const {
    if (c == rhs.c) return b < rhs.b;
    return c > rhs.c;
  }
};
bool check(long long x) {
  priority_queue<node> pq;
  for (int i = 1; i <= n; i++) pq.push({a[i], b[i], a[i] / b[i]});
  bool flag = 1;
  for (int i = 0; i < k; i++) {
    node item = pq.top();
    pq.pop();
    if (item.a / item.b < i) {
      flag = 0;
      break;
    }
    if (item.a / item.b >= k - 1) {
      flag = 1;
      break;
    }
    item.a += x;
    item.c = item.a / item.b;
    pq.push(item);
  }
  return flag;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long MAX = 0;
  for (int i = 1; i <= n; i++) scanf("%lld", &b[i]), MAX = max(MAX, b[i]);
  long long l = 0, r = MAX * k;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (check(l))
    printf("%lld\n", l);
  else
    puts("-1");
  return 0;
}
