#include <bits/stdc++.h>
using namespace std;
struct Cmp {
  bool operator()(const pair<long long, long long> &lhs,
                  const pair<long long, long long> &rhs) {
    return lhs.first / lhs.second > rhs.first / rhs.second;
  }
};
const long long N = 200005;
long long n, totTime;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               Cmp>
    init_pq;
void init();
void process();
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  init();
  process();
  cout.flush();
  return 0;
}
void init() {
  cin >> n >> totTime;
  long long initPw[N], second[N];
  for (long long i = 0; i < n; i++) cin >> initPw[i];
  for (long long i = 0; i < n; i++) cin >> second[i];
  for (long long i = 0; i < n; i++) {
    init_pq.emplace(initPw[i], second[i]);
  }
}
bool ok(long long charge) {
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >, Cmp>
      pq = init_pq;
  for (long long t = 1; t < totTime; t++) {
    pair<long long, long long> f = pq.top();
    pq.pop();
    f.first += charge;
    pq.push(f);
    f = pq.top();
    if (f.second * t > f.first) return false;
  }
  return true;
}
void bs(long long l, long long h) {
  long long low = l, high = h, mid, ans = -1;
  while (low <= high) {
    mid = (low + high) / 2;
    if (ok(mid))
      ans = mid, high = mid - 1;
    else
      low = mid + 1;
  }
  cout << ans << '\n';
}
void process() {
  long long MAX = 4000000000000ll;
  long long pw = 1;
  while (!ok(pw) && pw < MAX) pw *= 2;
  if (pw >= MAX)
    cout << -1 << '\n';
  else
    bs(pw / 2, pw);
}
