#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k;
  cin >> m >> k;
  vector<int> d(m);
  vector<int> s(m);
  for (int i = 0; i < m; i++) cin >> d[i];
  for (int i = 0; i < m; i++) cin >> s[i];
  vector<int> A(m);
  vector<int> I(m);
  int mx = 0;
  for (int i = 0; i < m; i++) {
    if (s[i] > mx) {
      mx = s[i];
    }
    A[i] = mx;
  }
  int g = 0;
  int t = 0;
  for (int i = 0; i < m; i++) {
    g += s[i];
    while (g < d[i]) {
      g += A[i];
      t += k;
    }
    t += d[i];
    g -= d[i];
  }
  cout << t << endl;
}
