#include <bits/stdc++.h>
using namespace std;
int m, k;
long long D[1005], S[1005];
int main() {
  while (scanf("%d%d", &m, &k) == 2) {
    for (int i = 0; i < m; ++i) cin >> D[i];
    for (int i = 0; i < m; ++i) cin >> S[i];
    long long i = 0, ans = 0, gas = 0, maxi = 0;
    while (1) {
      if (i == m) break;
      gas += S[i];
      maxi = max(maxi, S[i]);
      if (gas >= D[i]) {
        gas -= D[i];
        ans += D[i];
      } else {
        long long t = (D[i] - gas - 1) / maxi + 1;
        ans += k * t;
        ans += D[i];
        gas += t * maxi;
        gas -= D[i];
      }
      i++;
    }
    cout << ans << endl;
  }
}
