#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> d(n), s(n);
  for (int i = 0; i < n; i++) cin >> d[i];
  for (int i = 0; i < n; i++) cin >> s[i];
  int mf = 0;
  int ans = 0;
  int tank = 0;
  for (int i = 0; i < n; i++) {
    tank += s[i];
    if (mf < s[i]) mf = s[i];
    while (tank < d[i]) {
      tank += mf;
      ans += k;
    }
    ans += d[i];
    tank -= d[i];
  }
  cout << ans << endl;
  return 0;
}
