#include <bits/stdc++.h>
using namespace std;
int d[1000];
int s[1000];
int best[1000];
int main(void) {
  int m, k;
  cin >> m >> k;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    cin >> d[i];
    ans += d[i];
  }
  for (int i = 0; i < m; i++) cin >> s[i];
  best[0] = s[0];
  for (int i = 1; i < m; i++) best[i] = max(best[i - 1], s[i]);
  int fuel = 0;
  for (int i = 0; i < m; i++) {
    fuel += s[i];
    if (fuel >= d[i])
      fuel -= d[i];
    else {
      while (fuel < d[i]) {
        fuel += best[i];
        ans += k;
      }
      fuel -= d[i];
    }
  }
  cout << ans << endl;
}
