#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k;
  cin >> m >> k;
  vector<int> fuels;
  vector<int> paths;
  int sum_paths = 0;
  for (int(i) = 0; (i) < (m); ++(i)) {
    int temp;
    cin >> temp;
    paths.push_back(temp);
    sum_paths += temp;
  }
  for (int(i) = 0; (i) < (m); ++(i)) {
    int temp;
    cin >> temp;
    fuels.push_back(temp);
  }
  int act = 0;
  int mx = 0;
  int out = 0;
  for (int(i) = 0; (i) < (m); ++(i)) {
    mx = max(mx, fuels[i]);
    act += fuels[i];
    act -= paths[i];
    if (act < 0) {
      int take = ((-act) / mx) * mx;
      if (take < -act) take += mx;
      act += take;
      out += take / mx * k;
    }
  }
  cout << out + sum_paths << endl;
}
