#include <bits/stdc++.h>
template <class C, class E>
inline bool contains(const C& container, const E& element) {
  return container.find(element) != container.end();
}
template <class T>
inline void checkmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T& a, T b) {
  if (b > a) a = b;
}
using namespace std;
vector<long long> initCharge;
vector<long long> consum;
long long n, k;
long long DisTime(long long base, long long cons) { return base / cons; }
long long maxCan = 0000000000000000LL;
set<pair<long long, int>> disTimesBase;
bool Test(long long power) {
  vector<long long> inC = initCharge;
  vector<list<int>> mustCharge(k - 1);
  for (int i = (0), _b = ((n)-1); i <= _b; i++) {
    long long t = DisTime(inC[i], consum[i]);
    if (t < k - 1) mustCharge[t].push_back(i);
  }
  int remaining = 0;
  for (int t = (0), _b = ((k - 1) - 1); t <= _b; t++) {
    remaining++;
    for (int i : mustCharge[t]) {
      if (remaining == 0) return false;
      remaining--;
      inC[i] += power;
      long long t = DisTime(inC[i], consum[i]);
      if (t < k - 1) mustCharge[t].push_back(i);
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << std::setprecision(15);
  cout << std::fixed;
  cin >> n >> k;
  initCharge = vector<long long>(n);
  consum = vector<long long>(n);
  for (int i = (0), _b = ((n)-1); i <= _b; i++) cin >> initCharge[i];
  for (int i = (0), _b = ((n)-1); i <= _b; i++) cin >> consum[i];
  for (int i = (0), _b = ((n)-1); i <= _b; i++)
    checkmax(maxCan, consum[i] * k - initCharge[i]);
  if (Test(0)) {
    cout << 0;
    return 0;
  }
  if (!Test(maxCan)) {
    cout << -1;
    return 0;
  }
  long long minCant = 0;
  while (minCant + 1 != maxCan) {
    long long mid = minCant + (maxCan - minCant) / 2;
    if (Test(mid))
      maxCan = mid;
    else
      minCant = mid;
  }
  cout << maxCan;
  return 0;
}
