#include <bits/stdc++.h>
using namespace std;
const int N = 200025;
int n, k;
pair<int64_t, int64_t> v[N];
int64_t sum[N];
bool ok(int64_t x) {
  for (int i = 1; i <= k; i++) sum[i] = 0;
  for (int i = 0, cnt = 0; i < n; i++) {
    auto [a, b] = v[i];
    int64_t C = a - b * (k - 1);
    for (int j = 0; C + x * j < 0; j++) {
      int64_t T = (a + j * x) / b + 1;
      assert(T <= k);
      sum[T] += 1;
      if (++cnt > k) return false;
    }
  }
  for (int i = 1; i <= k; i++) sum[i] += sum[i - 1];
  for (int i = 1; i <= k; i++)
    if (sum[i] > i) return false;
  return true;
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> v[i].first;
  for (int i = 0; i < n; i++) cin >> v[i].second;
  int64_t x = -1;
  for (int64_t s = 1LL << 40; s; s >>= 1)
    if (!ok(x + s)) x += s;
  ++x;
  ((void)0);
  if (!ok(x)) return cout << -1 << '\n', 0;
  cout << x << '\n';
}
