#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000000000;
const int MOD = 1000000007;
const int M = INF;
int main() {
  double TIME_START = clock();
  int m, k;
  cin >> m >> k;
  vector<int> d(m);
  for (int i = 0; i < m; i++) cin >> d[i];
  vector<int> s(m + 1);
  for (int i = 0; i < m; i++) cin >> s[i];
  long long bak = s[0];
  long long ans = 0;
  long long max_pe = s[0];
  for (int i = 0; i < m; i++) {
    if (s[i] > max_pe) max_pe = s[i];
    if (d[i] > bak) {
      long long fill_times = ((d[i] - bak) + max_pe - 1) / max_pe;
      ans += fill_times * k;
      bak += fill_times * max_pe;
    }
    bak -= d[i];
    ans += d[i];
    bak += s[i + 1];
  }
  cout << ans;
  fprintf(stderr, "\n\n%.15lf\n\n",
          (double)(clock() - TIME_START) / CLOCKS_PER_SEC);
  return 0;
}
