#include <bits/stdc++.h>
using namespace std;
long long const MX = 2e5 + 10;
long long const INF = 1e9;
long long a[MX];
long long b[MX];
priority_queue<pair<pair<long long, long long>, pair<long long, long long>>>
    pq1;
int k, n;
bool check(long long num) {
  priority_queue<pair<pair<long long, long long>, pair<long long, long long>>>
      pq;
  pq = pq1;
  int rond = 1;
  bool tst = 1;
  while (rond <= k) {
    auto pp = pq.top();
    long long y = -pp.first.first, x = pp.first.second, z = pp.second.first,
              w = pp.second.second;
    if (y < rond) {
      tst = 0;
      break;
    }
    x -= (rond - z) * w;
    x += num;
    if (x < 0) {
      tst = 0;
      break;
    }
    y = x / w + 1;
    y += rond;
    z = rond;
    pq.pop();
    pq.push({{-y, x}, {z, w}});
    rond++;
  }
  if (-pq.top().first.first <= k || !tst) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  k--;
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (a[i] - b[i] < 0) cnt++;
  }
  if (cnt > 1) {
    cout << -1;
    return 0;
  }
  long long l = 0, r = 2000000000000, res = -1;
  for (int i = 0; i < n; i++) {
    long long t1 = a[i] / b[i];
    pq1.push({{-(t1 + 1), a[i]}, {0, b[i]}});
  }
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      res = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << res;
  return 0;
}
