#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const int N = (int)2e5 + 99;
int n, k;
long long a[N], b[N];
bool moze(long long x) {
  vector<vector<long long> > ispr(k);
  vector<long long> cur(n);
  for (int i = 0; i < n; ++i) cur[i] = a[i];
  for (int i = 0; i < n; ++i) {
    if (cur[i] / b[i] + 1 < k) ispr[cur[i] / b[i] + 1].push_back(i);
    cur[i] %= b[i];
  }
  int tren = 0;
  for (int j = 0; j < k; ++j) {
    while (tren < k && ispr[tren].empty()) ++tren;
    if (tren <= j) return false;
    if (tren == k) return true;
    int i = ispr[tren].back();
    if (cur[i] + x < b[i]) {
      cur[i] += x;
      continue;
    }
    ispr[tren].pop_back();
    long long jos = (cur[i] + x) / b[i];
    cur[i] = (cur[i] + x) % b[i];
    if (tren + jos < k) ispr[tren + jos].push_back(i);
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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, d = inf;
  while (l <= d) {
    long long m = (l + d) / 2;
    if (moze(m))
      d = m - 1;
    else
      l = m + 1;
  }
  cout << (l >= inf ? -1 : l);
  return 0;
}
