#include <bits/stdc++.h>
using namespace std;
long s[1003], d[1003], i, m, k, fuel, q, sm, ans, j;
void yoo(long x) {
  sm = s[1];
  for (j = 1; j <= x; j++) {
    if (sm < s[j]) sm = s[j];
  }
  if ((d[x] - fuel) % sm == 0)
    q = (d[x] - fuel) / sm;
  else
    q = (d[x] - fuel) / sm + 1;
  ans += k * q;
  fuel += sm * q;
}
int main() {
  cin >> m >> k;
  for (i = 1; i <= m; i++) {
    cin >> d[i];
  }
  for (i = 1; i <= m; i++) {
    cin >> s[i];
  }
  fuel = s[1];
  for (i = 1; i <= m; i++) {
    if (fuel < d[i]) {
      yoo(i);
    }
    fuel -= d[i];
    ans += d[i];
    fuel += s[i + 1];
  }
  cout << ans;
}
