#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k, d[1001], s[1001], i, n, max, j, time = 0, v;
  scanf("%d%d", &m, &k);
  for (i = 1; i <= m; i++) scanf("%d", &d[i]);
  for (i = 1; i <= m; i++) scanf("%d", &s[i]);
  time = 0;
  n = 0;
  for (i = 1; i <= m; i++) {
    n = n + s[i];
    if (n < d[i]) {
      max = 0;
      v = 0;
      for (j = 1; j <= i; j++) {
        if (max < s[j]) max = s[j];
      }
      if ((d[i] - n) % max != 0)
        v = v + (d[i] - n) / max + 1;
      else
        v = v + (d[i] - n) / max;
      n = n + max * v;
      time = time + v * k;
    }
    time = time + d[i];
    n = n - d[i];
  }
  printf("%d", time);
}
