#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long n, k;
long long A[N], B[N], survival_day[N], extra[N];
struct DATA {
  long long days, id;
  bool operator<(const DATA &P) const { return P.days < days; }
};
priority_queue<DATA> st;
bool check(long long charge) {
  while (!st.empty()) {
    st.pop();
  }
  for (int i = 1; i <= n; i++) {
    extra[i] = 0;
    if (survival_day[i] > k) continue;
    st.push({survival_day[i], i});
  }
  for (int day = 1; day <= k; day++) {
    if (st.empty()) return 1;
    DATA P = st.top();
    st.pop();
    if (day > P.days + 1) return 0;
    extra[P.id] += charge;
    long long newday = (A[P.id] + extra[P.id]) / B[P.id];
    if (newday > k) continue;
    st.push({newday, P.id});
  }
  return 1;
}
int main() {
  scanf("%lld %lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &A[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &B[i]);
  for (int i = 1; i <= n; i++) survival_day[i] = A[i] / B[i];
  long long lo = 0, hi = 3e12, mid, ans = -1;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    bool dec = check(mid);
    if (dec) {
      ans = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  printf("%lld\n", ans);
}
