#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int m, k;
  int i, j;
  int fuel = 0;
  int d[1002], s[1002], maxs = 0;
  int t = 0;
  cin >> m >> k;
  for (i = 0; i < m; i++) cin >> d[i];
  for (i = 0; i < m; i++) cin >> s[i];
  for (i = 0; i < m; i++) {
    fuel += s[i];
    maxs = max(maxs, s[i]);
    while (fuel < d[i]) {
      t += k;
      fuel += maxs;
    }
    t += d[i];
    fuel -= d[i];
  }
  cout << t;
}
