#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 5;
int d[maxn], s[maxn];
int n, k;
void solve() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  int t = 0, M = s[1], fuel = s[1];
  for (int i = 1; i <= n; i++) {
    while (fuel < d[i]) {
      fuel += M;
      t += k;
    }
    fuel -= d[i];
    t += d[i];
    fuel += s[i + 1];
    M = max(M, s[i + 1]);
  }
  cout << t;
}
int main() {
  solve();
  return 0;
}
