#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 5;
int a[MAX];
int m, k;
int s[MAX];
int res = 0;
void input() {
  cin >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> s[i];
  }
}
void caculate() {
  int xang = s[1];
  int duong = a[1];
  int pos = 1;
  while (pos != m + 1) {
    while (xang < a[pos]) {
      int max = *max_element(s + 1, s + 1 + pos);
      xang = xang + max;
      res = res + k;
    }
    xang = xang - a[pos] + s[pos + 1];
    res = res + a[pos];
    pos++;
  }
  cout << res << endl;
}
int main() {
  input();
  caculate();
  return 0;
}
