#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
const long long INF = 2e12;
template <typename T>
inline void Read(T &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0'; ch = getchar())
    ;
  for (; ch >= '0'; ch = getchar()) x = x * 10 + ch - '0';
}
int n, k;
long long a[MAXN], aa[MAXN], b[MAXN];
vector<int> c[MAXN];
bool check(long long pw) {
  for (int i = 1; i < k; i++) c[i].clear();
  for (int i = 1; i <= n; i++) aa[i] = a[i];
  for (int i = 1; i <= n; i++)
    if (a[i] / b[i] + 1 < k) c[a[i] / b[i] + 1].push_back(i);
  int p = 0;
  for (int i = 1; i < k; i++)
    if (((int)c[i].size())) {
      for (int j = 0; j < ((int)c[i].size()); j++) {
        if (++p > i) return false;
        int id = c[i][j];
        aa[id] += pw;
        if (aa[id] / b[id] + 1 < k) c[aa[id] / b[id] + 1].push_back(id);
      }
    }
  return true;
}
int main() {
  Read(n);
  Read(k);
  for (int i = 1; i <= n; i++) Read(a[i]);
  for (int i = 1; i <= n; i++) Read(b[i]);
  long long l = 0, r = INF + 5;
  while (l < r) {
    long long mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (l > INF)
    cout << -1;
  else
    cout << l;
  return 0;
}
