#include <bits/stdc++.h>
using namespace std;
int x[1010];
int y[1010];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  for (int i = 0; i < n; i++) scanf("%d", &y[i]);
  int mm = 0;
  int total = 0;
  int now = 0;
  for (int i = 0; i < n; i++) {
    now += y[i];
    mm = max(mm, y[i]);
    while (now < x[i]) {
      now += mm;
      total += k;
    }
    now -= x[i];
    total += x[i];
  }
  printf("%d\n", total);
  return 0;
}
