#include <bits/stdc++.h>
int m, k, d[1001], s[1001], ans;
int main() {
  scanf("%d%d", &m, &k);
  for (int i = 0; i < m; i++) scanf("%d", d + i);
  for (int i = 0; i < m; i++) scanf("%d", s + i);
  int lft = 0, mx = -1;
  for (int i = 0; i < m; i++) {
    lft += s[i];
    mx = (mx) < (s[i]) ? (s[i]) : (mx);
    if (d[i] > lft) {
      int dif = d[i] - lft;
      int tme = dif / mx + (dif % mx != 0);
      ans += tme * k;
      lft += mx * tme;
    }
    lft -= d[i];
    ans += d[i];
  }
  printf("%d\n", ans);
}
