#include <bits/stdc++.h>
const double pi = acos(-1.0);
const double eps = 1e-9;
using namespace std;
const int N = 2e5 + 10;
int n, k;
long long a[N], b[N], cur[N];
vector<long long> scan[N];
bool ok(long long x) {
  for (int i = 0; i < N; i++) {
    scan[i].clear();
  }
  for (int i = 0; i < n; i++) {
    cur[i] = a[i];
    long long t = a[i] / b[i] + 1;
    if (t >= k) {
      continue;
    }
    cur[i] %= b[i];
    scan[t].push_back(i);
  }
  int last = 0;
  for (int i = 0; i < k; i++) {
    while (last < k && scan[last].empty()) {
      last++;
    }
    if (last == k) {
      return true;
    }
    if (last <= i) {
      return false;
    }
    int id = scan[last].back();
    if (cur[id] + x < b[id]) {
      cur[id] += x;
      continue;
    }
    scan[last].pop_back();
    long long newT = (cur[id] + x) / b[id];
    cur[id] = (cur[id] + x) % b[id];
    if (last + newT < k) {
      scan[last + newT].push_back(id);
    }
  }
  return true;
}
void solve() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long l = 0, r = 1e18 + 1;
  while (r - l > 1) {
    long long mid = (l + r) >> 1;
    if (ok(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (ok(r - 1)) {
    r--;
  }
  if (!ok(r)) {
    cout << -1 << endl;
    return;
  }
  cout << r << endl;
}
int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(9);
  int step = 1;
  for (int i = 0; i < step; i++) {
    solve();
  }
}
