#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
const double eps = 1e-10;
const int MX = 2e5 + 5;
int n, m, k, b[MX];
long long a[MX], times[MX];
bool good(long long x) {
  set<pair<int, pair<int, int>>> s;
  for (int i = 0; i < int(n); ++i) {
    if (a[i] / b[i] >= k) continue;
    s.insert(make_pair(a[i] / b[i], make_pair(a[i] - a[i] / b[i] * b[i], i)));
  }
  for (int i = 0; i < int(k); ++i) {
    if (s.empty()) return true;
    int checkTime = s.begin()->first;
    long long currVal = s.begin()->second.first;
    int currIdx = s.begin()->second.second;
    if (checkTime < i) return false;
    s.erase(s.begin());
    currVal += x;
    if (checkTime + currVal / b[currIdx] >= k) continue;
    s.insert(make_pair(
        checkTime + currVal / b[currIdx],
        make_pair(currVal - currVal / b[currIdx] * b[currIdx], currIdx)));
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin >> n >> k;
  for (int i = 0; i < int(n); ++i) cin >> a[i];
  for (int i = 0; i < int(n); ++i) cin >> b[i];
  for (int i = 0; i < int(n); ++i) times[i] = a[i] / b[i];
  sort(times, times + n);
  bool zero = true;
  for (int i = 0; i < int(n); ++i)
    if (i > times[i]) {
      cout << "-1\n";
      return 0;
    } else if (times[i] < k)
      zero = false;
  if (zero) {
    cout << "0\n";
    return 0;
  }
  long long lo = 0, hi = 1e18;
  while (lo < hi) {
    long long mid = (lo + hi) / 2;
    if (good(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << '\n';
  return 0;
}
