#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int inf = 0x7FFFFFFF;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
int dp[1001][1001];
int s[1001], d[1001];
int main() {
  int n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) cin >> d[i];
    for (int i = 0; i < n; i++) {
      cin >> s[i];
    }
    memset(dp, 37, sizeof(dp));
    int t = 0;
    int mx = 0;
    int f = 0;
    for (int i = 0; i < n; i++) {
      checkmax(mx, s[i]);
      f += s[i];
      while (f < d[i + 1]) {
        f += mx;
        t += m;
      }
      t += d[i + 1];
      f -= d[i + 1];
    }
    cout << t << endl;
  }
  return 0;
}
