#include <bits/stdc++.h>
using namespace std;
long long m, k, arr[1005], road[1005];
long long sum = 0, nowThere = 0, mx = -1, ans = 0, w;
int main() {
  scanf("%lld%lld", &m, &k);
  for (int i = 0; i < m; i++) scanf("%lld", &road[i]);
  for (int i = 0; i < m; i++) scanf("%lld", &arr[i]);
  for (int i = 0; i < m; i++) {
    nowThere += arr[i];
    mx = max(mx, arr[i]);
    sum += road[i];
    if (road[i] > nowThere) {
      w = road[i] - nowThere;
      w = (w / mx) + (w % mx > 0);
      sum += w * k;
      nowThere += w * mx;
    }
    nowThere -= road[i];
  }
  printf("%lld", sum);
  return 0;
}
