#include <bits/stdc++.h>
int d[1000], s[1000];
int main() {
  int m, k;
  int i, j;
  scanf("%d %d", &m, &k);
  for (i = 0; i < m; i++) scanf("%d", &d[i]);
  for (i = 0; i < m; i++) scanf("%d", &s[i]);
  int p = 0;
  int st = 0;
  int max = 0;
  int ans = 0;
  while (p < m) {
    st += s[p];
    if (max < s[p]) max = s[p];
    while (st < d[p]) {
      ans += k;
      st += max;
    }
    st -= d[p];
    ans += d[p];
    p++;
  }
  printf("%d\n", ans);
  return 0;
}
