#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, k;
long long b[200003];
bool can(long long x, vector<long long> a) {
  long long i, j;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      pq;
  for (i = 1; i <= n; ++i) pq.push({a[i] / b[i] + 1, i});
  for (i = 1; i <= k; ++i) {
    pair<long long, long long> p = pq.top();
    pq.pop();
    if (p.first < i) return false;
    j = p.second;
    a[j] += x;
    pq.push({a[j] / b[j] + 1, j});
  }
  return true;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  long long i, j;
  vector<long long> a(200003);
  for (i = 1; i <= n; ++i) cin >> a[i];
  for (i = 1; i <= n; ++i) cin >> b[i];
  long long lo = 0, hi = 1e13, mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (can(mid, a))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << (mid > 2 * 1e12 ? -1 : (can(mid, a) ? mid : mid + 1));
  return 0;
}
