#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k;
  int d[2000];
  int s, maxs, fu;
  cin >> m >> k;
  for (int i = 0; i < m; i++) cin >> d[i];
  int c = 0;
  fu = 0;
  maxs = 0;
  int t = 0;
  while (c < m) {
    cin >> s;
    fu += s;
    maxs = max(maxs, s);
    while (fu < d[c]) {
      fu += maxs;
      t += k;
    }
    t += d[c];
    fu -= d[c];
    c++;
  }
  cout << t << endl;
}
