#include <bits/stdc++.h>
using namespace std;
class classcomp {
 public:
  bool operator()(const int& l, const int& r) const { return l < r; }
};
int main() {
  int m, k;
  scanf("%d%d", &m, &k);
  int d[1010], s[1010];
  int i, j, l;
  for (i = 0; i < m; i++) scanf("%d", &d[i]);
  for (i = 0; i < m; i++) scanf("%d", &s[i]);
  s[m] = 0;
  int fuel = 0;
  int mmax = s[0];
  int time = 0;
  for (i = 0; i < m; i++) {
    mmax = max(s[i], mmax);
    if (fuel >= d[i]) {
      fuel -= d[i];
      fuel += s[i + 1];
      time += d[i];
    } else {
      int num = ceil((d[i] - fuel) / (mmax * 1.0));
      time += num * k;
      fuel += num * mmax;
      fuel += s[i + 1];
      time += d[i];
      fuel -= d[i];
    }
  }
  printf("%d\n", time - k);
  return 0;
}
