#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> roads(n);
  for (int i = 0; i < n; ++i) cin >> roads[i];
  vector<int> cities(n);
  for (int i = 0; i < n; ++i) cin >> cities[i];
  int cur_place = 0;
  int cur_fuel = cities[0];
  int ans = 0;
  int mx = 0;
  while (cur_place != n + 1) {
    while (cur_place < n && cur_fuel - roads[cur_place] >= 0) {
      cur_fuel -= roads[cur_place];
      ans += roads[cur_place];
      ++cur_place;
      if (cur_place < n) cur_fuel += cities[cur_place];
    }
    if (cur_place == n) break;
    int mx = 0;
    for (int j = 0; j <= cur_place; ++j) mx = max(mx, cities[j]);
    cur_fuel += mx;
    ans += k;
  }
  cout << ans;
}
