#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int m, k, act = 0, mx = 0, res = 0;
  cin >> m >> k;
  vector<int> d(m), s(m);
  for (int i = 0; i < (m); ++i) cin >> d[i];
  for (int i = 0; i < (m); ++i) cin >> s[i];
  for (int i = 0; i < (m); ++i) {
    act += s[i];
    if (s[i] > mx) mx = s[i];
    while (d[i] > act) {
      act += mx;
      res += k;
    }
    res += d[i];
    act -= d[i];
  }
  cout << res << endl;
}
