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