#include <bits/stdc++.h>
using namespace std;
int n, k;
int d[1001], s[1001];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int tank = 0, big = 0, time = 0;
  for (int i = 0; i < n; i++) {
    tank += s[i];
    if (s[i] > big) {
      big = s[i];
    }
    while (tank < d[i]) {
      tank += big;
      time += k;
    }
    time += d[i];
    tank -= d[i];
  }
  cout << time << endl;
}
