#include <bits/stdc++.h>
using namespace std;
void precompute(void) {}
int main() {
  int mul, m, k, d[1024], s[1024], i, time, pos, best;
  precompute();
  while (scanf("%d%d", &m, &k) != EOF) {
    for (i = 0; i < m; i++) {
      scanf("%d", &d[i]);
      if (i != 0) d[i] += d[i - 1];
    }
    for (i = 0; i < m; i++) scanf("%d", &s[i]);
    best = s[0];
    pos = 0;
    time = 0;
    for (i = 0; i < m; i++) {
      pos += s[i];
      best = max(best, s[i]);
      while (pos < d[i]) {
        mul = (d[i] - pos) / best;
        pos += best * mul;
        time += mul * k;
        if (pos < d[i]) {
          pos += best;
          time += k;
        }
      }
    }
    time += d[m - 1];
    printf("%d\n", time);
  }
  return 0;
}
