#include <bits/stdc++.h>
using namespace std;
int m, k, d[1000 + 10], s[1000 + 10], cnt, sum, M;
int main() {
  cin >> m >> k;
  for (int i = 0; i < m; i++) cin >> d[i];
  for (int i = 0; i < m; i++) cin >> s[i];
  for (int i = 0; i < m; i++) {
    sum = sum + s[i] - d[i];
    cnt += d[i];
    if (M < s[i]) M = s[i];
    while (sum < 0) {
      sum += M;
      cnt += k;
    }
  }
  cout << cnt << endl;
}
