#include <bits/stdc++.h>
using namespace std;
int d[1010], s[1010], n, k, CC, v, maxs;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &d[i]), CC += d[i];
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (int i = 1; i <= n; i++) {
    v += s[i];
    maxs = max(maxs, s[i]);
    if (v >= d[i]) {
      v -= d[i];
      continue;
    }
    int t = (d[i] - v) / maxs;
    if (t * maxs + v < d[i]) t++;
    v += maxs * t, CC += k * t;
    v -= d[i];
  }
  cout << CC << endl;
  return 0;
}
