#include <bits/stdc++.h>
using namespace std;
int d[1005];
int s[1005];
int main() {
  int m, k;
  cin >> m >> k;
  for (int i = 0; i < m; i++) cin >> d[i];
  for (int i = 0; i < m; i++) cin >> s[i];
  int maxV = 0;
  int sum = 0;
  int res = 0;
  for (int i = 0; i < m; i++) {
    sum += s[i];
    maxV = ((maxV) > (s[i]) ? (maxV) : (s[i]));
    while (sum < d[i]) {
      res += k;
      sum += maxV;
    }
    res += d[i];
    sum -= d[i];
  }
  cout << res << endl;
  return 0;
}
