#include <bits/stdc++.h>
using namespace std;
int n, k, ans, ms, val, d[1111], s[1111];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) scanf("%d", d + i);
  for (int i = 1; i <= n; ++i) scanf("%d", s + i);
  for (int i = 1; i <= n; ++i) {
    ans += d[i], val += s[i];
    ms = max(ms, s[i]);
    while (val < d[i]) ans += k, val += ms;
    val -= d[i];
  }
  cout << ans << endl;
}
