#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#define endl '\n'
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N = 100010;
int n,m;
LL ans,oil,dist;
int v[N],a[N];
void solve()
{
cin >> n >> m;
for (int i = 1;i < n;i ++) cin >> v[i];
for (int i = 1;i <= n;i ++) cin >> a[i];
int price = a[1];
for (int i = 2;i <= n;i ++)
{
dist += v[i - 1]; //先更新距离
LL t = (dist + m - 1) / m - oil; //需要多少油
ans += t * price; //累加答案
oil += t; //更新现在有的油量
price = min(price,a[i]); // 更新最低油价
}
cout << ans << endl;
}
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int _ = 1;
while(_--) solve();
return 0;
}