#include <bits/stdc++.h>
using namespace std;
const long long N = 2 * 1e5 + 20;
vector<long long> que[N];
bool check(long long c[], long long b[], long long charger, long long n,
           long long k) {
  for (int i = 0; i < k + 1; i++) que[i].clear();
  long long a[n];
  for (int i = 0; i < n; i++) {
    a[i] = c[i];
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] / b[i] + 1 >= k) continue;
    que[a[i] / b[i] + 1].push_back(i);
  }
  long long start_index = 0;
  for (long long t = 0; t < k; t++) {
    while (start_index < k && que[start_index].empty()) start_index++;
    if (start_index <= t) return false;
    if (start_index == k) return true;
    long long temp = que[start_index].back();
    que[start_index].pop_back();
    if ((a[temp] + charger) / b[temp] + 1 < k) {
      a[temp] = a[temp] + charger;
      que[(a[temp]) / b[temp] + 1].push_back(temp);
    }
  }
  return true;
}
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  ;
  for (long long i = 0; i < n; i++) cin >> b[i];
  long long high = 1000000000000000000;
  long long low = 0;
  while (low < high) {
    long long mid = low + (high - low) / 2;
    if (check(a, b, mid, n, k))
      high = mid;
    else
      low = mid + 1;
  }
  if (high != (long long)1000000000000000000)
    cout << low << endl;
  else
    cout << -1 << endl;
}
