#include <bits/stdc++.h>
using namespace std;
int fu[2003];
int jar[2003];
int main() {
  int n, refresh;
  cin >> n >> refresh;
  for (int(i) = 0; (i) < (n); ++(i)) {
    cin >> jar[i];
  }
  for (int(i) = 0; (i) < (n); ++(i)) {
    cin >> fu[i];
  }
  int best = fu[0];
  int res = 0;
  int gas = 0;
  for (int i = 0; i < n; ++i) {
    gas += fu[i];
    best = max((best), (fu[i]));
    while (gas < jar[i]) {
      gas += best;
      res += refresh;
    }
    gas -= jar[i];
    res += jar[i];
  }
  cout << res << endl;
  return 0;
}
