#include <bits/stdc++.h>
int d[1100], s[1100];
int m, k;
int main() {
  int i, time = 0, fuel = 0, t = 0;
  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]);
  for (i = 0; i < m; i++) {
    if (t < s[i]) t = s[i];
    fuel += s[i];
    while (fuel < d[i]) {
      time += k;
      fuel += t;
    }
    time += d[i];
    fuel -= d[i];
  }
  printf("%d\n", time);
  return 0;
}
