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