#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  vector<int> listm;
  vector<int> listk;
  for (int i = 0; i < t; i++) {
    int m, k;
    cin >> m >> k;
    int sum = 0;
    int max = 0;
    for (int i = 0; i < m; i++) {
      int tmp;
      cin >> tmp;
      listm.push_back(tmp);
    }
    for (int i = 0; i < m; i++) {
      int tmp;
      cin >> tmp;
      listk.push_back(tmp);
    }
    max = listk[0];
    int fuul = 0;
    int tmp;
    for (int i = 0; i < m; i++) {
      if (max < listk[i]) {
        max = listk[i];
      }
      fuul += listk[i];
      tmp = fuul;
      fuul -= listm[i];
      while (fuul < 0) {
        fuul = tmp;
        fuul += max;
        sum += k;
        tmp = fuul;
        fuul -= listm[i];
      }
      if (fuul >= 0) {
        sum += listm[i];
      }
      if (max < listk[i]) max = listk[i];
    }
    cout << sum << endl;
    listm.clear();
    listk.clear();
  }
  return 0;
}
