#include <bits/stdc++.h>
using namespace std;
FILE *f, *g;
int s[1100], d[1100];
int i, m, n, rez, mx, k, sol;
int main() {
  scanf("%d%d", &m, &k);
  for (i = 1; i <= m; i++) {
    scanf("%d", &d[i]);
    sol = sol + d[i];
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &s[i]);
  }
  rez = 0;
  mx = -1;
  for (i = 1; i <= m; i++) {
    rez += s[i];
    if (mx < s[i]) mx = s[i];
    if (rez - d[i] < 0) {
      while (rez - d[i] < 0) {
        sol += k;
        rez += mx;
      }
      rez = rez - d[i];
    } else
      rez = rez - d[i];
  }
  printf("%d", sol);
  return 0;
}
