#include <bits/stdc++.h>
using namespace std;
int n, runtime;
struct node {
  long long electric;
  long long consume;
  long long lastTime;
} student[200005], t;
bool operator<(node a, node b) { return a.lastTime > b.lastTime; }
bool test(long long charge) {
  long long i, tmp;
  priority_queue<node> q;
  for (i = 1; i <= n; i++) q.push(student[i]);
  for (i = 1; i <= runtime; i++) {
    t = q.top();
    q.pop();
    if (t.lastTime < i - 1) return false;
    if (t.lastTime >= runtime) return true;
    t.electric += charge;
    t.lastTime = t.electric / t.consume;
    q.push(t);
  }
  return true;
}
int main() {
  int i;
  long long mid, ans;
  long long left = 0, right = 1e15;
  scanf("%d%d", &n, &runtime);
  for (i = 1; i <= n; i++) scanf("%I64d", &student[i].electric);
  for (i = 1; i <= n; i++) scanf("%I64d", &student[i].consume);
  for (i = 1; i <= n; i++)
    student[i].lastTime = student[i].electric / student[i].consume;
  long long res = 0;
  while (left < right) {
    mid = left + (right - left) / 2;
    if (test(mid))
      right = mid;
    else
      left = mid + 1;
  }
  res = right == 1e15 ? -1 : right;
  cout << res << endl;
  return 0;
}
