#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a[1005] = {0};
  long long int b[1005] = {0};
  long long int m, k;
  cin >> m >> k;
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (long long int i = 0; i < m; i++) {
    cin >> b[i];
  }
  long long int count_h = 0, count_p = 0;
  long long int max = 0;
  for (long long int i = 0; i < m; i++) {
    if (max < b[i]) max = b[i];
    count_p += b[i];
    if (count_p < a[i]) {
      long long int required = (a[i] - count_p) / max;
      long long int fk = (a[i] - count_p) % max;
      if (fk == 0) {
        count_h += required * k;
        count_p += max * (required);
      } else {
        count_h += (required + 1) * k;
        count_p += max * (required + 1);
      }
    }
    count_h += a[i];
    count_p -= a[i];
  }
  cout << count_h;
  return 0;
}
