#include <bits/stdc++.h>
using namespace std;
int d[1005];
int s[1005];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> d[i];
  for (int i = 1; i <= n; i++) cin >> s[i];
  int now = 0, ans = 0, mx = 0;
  for (int i = 1; i <= n; i++) {
    now += s[i];
    mx = max(mx, s[i]);
    int need = d[i];
    if (now < need) {
      int dif = need - now;
      int fill = dif / mx + (dif % mx ? 1 : 0);
      ans += fill * k;
      now += fill * mx;
    }
    ans += d[i];
    now -= d[i];
  }
  cout << ans << "\n";
  return 0;
}
