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