#include <bits/stdc++.h>
using namespace std;
long long f[1001];
int main() {
  long long m, k, s[1001], d[1001], ff = 0, t = 0, j, maxi = -1, ind = -1;
  cin >> m >> k;
  for (long long i = 0; i < m; i++) cin >> d[i];
  for (long long i = 0; i < m; i++) cin >> s[i];
  long long i;
  for (i = 0; i < m; i++) {
    ff += s[i];
    if (ff < d[i]) {
      ind = i;
      for (j = i; j >= 0; j--) {
        if (s[ind] < s[j]) ind = j;
      }
      while (ff < d[i]) {
        ff += s[ind];
        t += k;
      }
    }
    t += d[i];
    ff -= d[i];
  }
  cout << t;
  return 0;
}
