#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdio>
using namespace std;
int n,d,v[10000001],a[10000001],gl,yuan,wei=1;
double you;
int main(){
cin >> n >> d;
for(int i=1;i < n;i++){
cin >> v[i];
}
for(int i=1;i <= n;i++){
cin >> a[i];
}
for(int i=1;i < n;i++){
gl += v[i];
int shen;
if(a[i+1] <= a[wei] || i+1 == n){
if(int(gl/d)*d < gl) shen = int(gl/d)+1;
else shen = int(gl/d);
double tt = shen+you;
if(d*tt >= gl && d*tt-gl >= d){
shen--;
}
you += shen;
yuan += shen*a[wei];
wei = i+1;
i = wei-1;
you -= gl/(d*1.0);
gl = 0;
}
}
cout << yuan;
return 0;
}