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