#include <bits/stdc++.h>
using namespace std;
int m, k;
int d[1005], s[1005];
int main() {
  int sum, maxs = 0;
  while (cin >> m >> k) {
    sum = 0;
    for (int i = 0; i < m; i++) {
      cin >> d[i];
      sum += d[i];
    }
    for (int i = 0; i < m; i++) cin >> s[i];
    int ss = 0;
    for (int i = 0; i < m; i++) {
      if (s[i] > maxs) maxs = s[i];
      ss += s[i];
      if (ss >= d[i]) {
        ss -= d[i];
        continue;
      } else {
        while (ss < d[i]) {
          ss += maxs;
          sum += k;
        }
        ss -= d[i];
      }
    }
    cout << sum << endl;
  }
  return 0;
}
