#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
int lcm(int x, int y) { return x / gcd(x, y) * y; }
int binpow(int a, int p) {
  if (!p) return 1;
  int g = binpow(a, p >> 1);
  if (p % 2 == 0)
    return (g * g) % 1000000007;
  else
    return (((g * g) % 1000000007) * a) % 1000000007;
}
int rev(int n) { return binpow(n, 1000000007 - 2); }
void solve();
int main() {
  cout.setf(ios::fixed);
  cout.precision(20);
  cerr.setf(ios::fixed);
  cerr.precision(3);
  int n = 1;
  for (int i = 0; i < n; ++i) solve();
}
long long m, k;
long long c[100100], d[100100];
void solve() {
  long long cur = 0, i, j;
  cin >> m >> k;
  for (i = 0; i < m; i++) cin >> d[i];
  for (i = 0; i < m; i++) cin >> c[i];
  c[m] = -(1000000000);
  long long best = c[0];
  long long res = 0;
  for (i = 0; i < m; i++) {
    cur += c[i];
    if (d[i] > cur) {
      long long dif = (d[i] - cur) / best;
      if ((d[i] - cur) % best != 0) dif++;
      cur += dif * best;
      res += dif * k;
    }
    cur -= d[i];
    res += d[i];
    if (c[i + 1] > best) best = c[i + 1];
  }
  cout << res << endl;
}
