#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k, d, s;
  vector<int> distance, fuel;
  int res = 0;
  cin >> m >> k;
  for (int i = 0; i < m; ++i) {
    cin >> d;
    distance.push_back(d);
  }
  for (int i = 0; i < m; ++i) {
    cin >> s;
    fuel.push_back(s);
  }
  int tank = 0;
  int mx = 0;
  for (int i = 0; i < distance.size(); ++i) {
    if (fuel[i] > mx) mx = fuel[i];
    tank += fuel[i];
    while (tank < distance[i]) {
      tank += mx;
      res += k;
    }
    tank -= distance[i];
    res += distance[i];
  }
  cout << res << endl;
  return 0;
}
