#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long i;
  long long c;
  long long t;
  bool operator<(const Node &b) const { return t == b.t ? i < b.i : t > b.t; }
};
const int MAXN = 2e5 + 5LL;
long long a[MAXN], b[MAXN], n, t;
priority_queue<Node> qt;
inline bool judge(long long x) {
  priority_queue<Node> q = qt;
  for (register long long i = 1LL; i < t; ++i) {
    Node nxt = q.top();
    q.pop();
    if (nxt.t == i) {
      if (!q.empty()) {
        Node nxtp = q.top();
        if (nxtp.t == i) return false;
      }
      ++nxt.c;
      nxt.t = i + (a[nxt.i] - i * b[nxt.i] + x * nxt.c) / b[nxt.i] + 1LL;
      if (a[nxt.i] - i * b[nxt.i] + x * nxt.c < 0LL) return false;
      q.push(nxt);
    } else {
      ++nxt.c;
      nxt.t = i + (a[nxt.i] - i * b[nxt.i] + x * nxt.c) / b[nxt.i] + 1LL;
      q.push(nxt);
    }
  }
  return true;
}
int main() {
  scanf("%I64d %I64d", &n, &t);
  for (register long long i = 1LL; i <= n; ++i) scanf("%I64d", &a[i]);
  for (register long long i = 1LL; i <= n; ++i) {
    scanf("%I64d", &b[i]);
    long long tmp = a[i] / b[i] + 1LL;
    if (tmp <= t) qt.push((Node){i, 0LL, tmp});
  }
  if (qt.empty()) {
    printf("0");
    return 0;
  }
  long long l = 0LL, r = (long long)2e12, ans = -1LL;
  for (; l < r;) {
    long long mid = (l + r) >> 1LL;
    if (judge(mid)) {
      r = mid;
      ans = mid;
    } else {
      l = mid + 1LL;
    }
  }
  printf("%I64d", ans);
  return 0;
}
