#include <bits/stdc++.h>
using namespace std;
int n, k, d[1100], s[1100];
int main() {
  cin >> n >> k;
  for (typeof((n)-1) i = (0); i <= ((n)-1); i++) {
    scanf("%d", &d[i]);
  }
  for (typeof((n)-1) i = (0); i <= ((n)-1); i++) {
    scanf("%d", &s[i]);
  }
  int fuel = 0, time = 0, mx = 0;
  for (typeof((n)-1) i = (0); i <= ((n)-1); i++) {
    fuel += s[i];
    mx = max(s[i], mx);
    if (fuel >= d[i]) {
      fuel -= d[i];
      time += d[i];
    } else {
      while (fuel < d[i]) fuel += mx, time += k;
      fuel -= d[i];
      time += d[i];
    }
  }
  cout << time << endl;
  return 0;
}
