#include <bits/stdc++.h>
using namespace std;
const int DBG = 0, INF = int(1e9);
const int MAXM = 1000;
int d[MAXM], s[MAXM];
int main() {
  ios_base::sync_with_stdio(0);
  cout.setf(ios::fixed);
  int m, k;
  cin >> m >> k;
  for (int _n = (m), i = 0; i < _n; ++i) cin >> d[i];
  for (int _n = (m), i = 0; i < _n; ++i) cin >> s[i];
  int res = 0, mx = 0, cr = 0;
  for (int _n = (m), i = 0; i < _n; ++i) {
    mx = max(mx, s[i]);
    cr += s[i];
    if (d[i] > cr) {
      int numWaits = (d[i] - cr + mx - 1) / mx;
      cr += numWaits * mx;
      res += numWaits * k;
    }
    cr -= d[i];
    res += d[i];
  }
  cout << res << endl;
  return 0;
}
