#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, d;
int a[maxn], v[maxn];
long long ans = 0;
int main() {
cin >> n >> d;
for (int i = 1; i < n; i++) {
cin >> v[i];
v[i] = ceil(v[i] / double(d));
}
for (int i = 1; i <= n; i++) cin >> a[i];
int res = 0;
int mi = INT_MAX;
for (int i = 1; i < n; i++) {
mi = min(mi, a[i]);
if (res >= v[i]) {
res -= v[i];
} else {
int need = v[i] - res;
if (need < 0) need = 0;
ans += need * mi;
res = need;
}
}
cout << ans << endl;
return 0;
}