#include <bits/stdc++.h>
using namespace std;
long long m, s[1024], d[1024], k;
int main() {
  long long v = 0, t = 0, br = 0, i, j;
  cin >> m >> k;
  for (i = 1; i <= m; i++) cin >> d[i];
  for (i = 1; i <= m; i++) cin >> s[i];
  long long p;
  for (i = 1; i <= m; i++) {
    p = d[i];
    v += s[i];
    t += d[i];
    if (v < p) {
      long long mx = 0;
      for (j = 1; j <= i; j++)
        if (s[j] > mx) mx = s[j];
      while (p > v) {
        br++;
        p -= mx;
      }
      v += br * mx;
      t += br * k;
      br = 0;
    }
    v -= d[i];
  }
  cout << t << endl;
  return 0;
}
