#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m, k, p;
  cin >> m >> k;
  vector<int> d(m);
  for (int i = 0; i < m; ++i) {
    cin >> d[i];
  }
  int ans = 0, now = 0, need;
  priority_queue<int> a;
  for (int i = 0; i < m; ++i) {
    cin >> p;
    a.push(p);
    ans += d[i];
    now += p;
    if (now < d[i]) {
      need = d[i] - now;
      ans += k * ((need + a.top() - 1) / (a.top()));
      if (need % a.top())
        now = a.top() - need % a.top();
      else
        now = 0;
    } else {
      now -= d[i];
    }
  }
  cout << ans << '\n';
  return 0;
}
