#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, m, k, dist, oil, best, pos, lack, tot, mul, good[1010];
  double avg;
  vector<int> d, s;
  while (scanf("%d %d", &m, &k) == 2) {
    d.clear();
    s.clear();
    memset(good, 0, sizeof(good));
    best = 0;
    for (i = 0; i < m; i++) {
      scanf("%d", &j);
      d.push_back(j);
    }
    for (i = 0; i < m; i++) {
      scanf("%d", &j);
      if (j > best) {
        best = j;
        pos = i;
      }
      s.push_back(j);
    }
    good[0] = s[0];
    for (i = 1; i < m; i++) {
      good[i] = max(good[i - 1], s[i]);
    }
    oil = 0;
    dist = 0;
    for (i = 0; i < m; i++) {
      oil += s[i];
      while (oil < d[i]) {
        oil += good[i];
        dist += k;
      }
      oil -= d[i];
      dist += d[i];
    }
    printf("%d\n", dist);
  }
  return 0;
}
