#include <bits/stdc++.h>
int n, k;
long long a[201000];
int b[201000];
long long c[201000];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  long long l = 0, r = 2e12 + 1;
  while (l < r) {
    long long mid = l + r >> 1;
    std::priority_queue<std::pair<long long, long long>,
                        std::vector<std::pair<long long, long long> >,
                        std::greater<std::pair<long long, long long> > >
        pq;
    for (int i = 1; i <= n; i++)
      pq.push(std::pair<long long, long long>(a[i] / b[i], i)), c[i] = a[i];
    bool ok = 0;
    for (int i = 0; i < k; i++) {
      std::pair<long long, long long> p = pq.top();
      pq.pop();
      if (p.first < i) {
        ok = 1;
        break;
      }
      if (p.first >= k - 1) break;
      c[p.second] += mid;
      p.first = c[p.second] / b[p.second];
      pq.push(p);
    }
    if (ok)
      l = mid + 1;
    else
      r = mid;
  }
  if (r == (long long)2e12 + 1)
    puts("-1");
  else
    printf("%lld\n", r);
  return 0;
}
