#include <bits/stdc++.h>
using namespace std;
int m, k, dis[1000005], oil[1000005];
void dataIn() {
  scanf("%d%d", &m, &k);
  for (register int i = 1; i <= m; i++) scanf("%d", &dis[i]);
  for (register int j = 1; j <= m; j++) scanf("%d", &oil[j]);
}
int tanxin() {
  int totDis = 0, totOil = 0, maxOil = -1, times = 0;
  for (int i = 1; i <= m; i++) {
    maxOil = max(maxOil, oil[i]);
    totDis += dis[i];
    totOil += oil[i];
    while (totOil < totDis) {
      totOil += maxOil;
      times++;
    }
  }
  return totDis + times * k;
}
int main() {
  dataIn();
  cout << tanxin();
  return 0;
}
