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