#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
const long long INF = 1001001001001001ll;
long long N, K;
long long A[222222], B[222222];
bool check(long long x) {
  vector<long long> a(N);
  for (long long i = 0; i < (N); i++) a[i] = A[i];
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      que;
  for (long long i = 0; i < (N); i++) {
    if (a[i] < K * B[i]) que.push(pair<long long, long long>(a[i] / B[i], i));
  }
  for (long long t = 0; t < K; t++) {
    if (que.empty()) break;
    long long i = que.top().second;
    que.pop();
    if (a[i] < t * B[i]) return false;
    a[i] += x;
    if (a[i] < K * B[i]) que.push(pair<long long, long long>(a[i] / B[i], i));
  }
  for (long long i = 0; i < (N); i++)
    if (a[i] < B[i] * K) return false;
  return true;
}
signed main() {
  scanf("%lld%lld", &N, &K);
  K--;
  for (long long i = 0; i < (N); i++) scanf("%lld", &A[i]);
  for (long long i = 0; i < (N); i++) scanf("%lld", &B[i]);
  long long lb = -1, ub = INF;
  while (ub - lb > 1) {
    long long mid = (ub + lb) / 2;
    if (check(mid))
      ub = mid;
    else
      lb = mid;
  }
  if (ub == INF)
    cout << -1 << endl;
  else
    cout << ub << endl;
}
