#include <bits/stdc++.h>
using namespace std;
int nextint() {
  int t;
  scanf("%d", &t);
  return t;
}
int d[1001];
int s[1001];
int maxinc[1001];
int main() {
  int n = nextint() + 1;
  int m = n - 1;
  int k = nextint();
  for (int i = 0; i < (m); i++) d[i] = nextint();
  for (int i = 0; i < (m); i++) s[i] = nextint();
  maxinc[0] = s[0];
  for (int i = (1); i <= (m - 1); i++) {
    maxinc[i] = max(maxinc[i - 1], s[i]);
  }
  int cur = 0;
  int curfuel = 0;
  int tm = 0;
  while (cur < m) {
    curfuel += s[cur];
    if (curfuel < d[cur]) {
      int cnt = (d[cur] - curfuel + maxinc[cur] - 1) / maxinc[cur];
      tm += cnt * k;
      curfuel += cnt * maxinc[cur];
    }
    curfuel -= d[cur];
    tm += d[cur];
    cur++;
  }
  printf("%d\n", tm);
  return 0;
}
