#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long sum = 0, ff = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      ff = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = sum * 10 + ch - 48;
    ch = getchar();
  }
  return sum * ff;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 2e5 + 7;
const long long INF = 2e12 + 7;
struct node {
  long long a, b, c;
  bool operator<(const node &x) const {
    if (x.c == c && x.b == b) return a > x.a;
    if (x.c == c) return b < x.b;
    return c > x.c;
  }
} s[N];
int n, k;
long long l, r = INF, mid, ans = -1;
bool check(long long x) {
  priority_queue<node> q;
  for (int i = 1; i <= n; i++)
    if (s[i].c < k) q.push(s[i]);
  if (q.empty()) return true;
  for (int i = 0; i <= k - 1; i++) {
    node now = q.top();
    q.pop();
    if (now.c < i) return false;
    if ((now.a + x) / now.b < k)
      q.push((node){now.a + x, now.b, (now.a + x) / now.b});
    if (q.empty()) return true;
  }
  return true;
}
int main() {
  n = read(), k = read();
  for (int i = 1; i <= n; i++) s[i].a = read();
  for (int i = 1; i <= n; i++) s[i].b = read(), s[i].c = s[i].a / s[i].b;
  while (l <= r) {
    if (check((mid = (l + r) >> 1)))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  write(ans);
  return 0;
}
