#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int m, k, d[maxn], s[maxn];
int main() {
  cin >> m >> k;
  int cnt1 = 0, cnt2 = 0, x = 0, time = 0;
  for (int i = 1; i <= m; i++) cin >> d[i];
  for (int i = 1; i <= m; i++) cin >> s[i];
  for (int i = 1; i <= m; i++) {
    x = max(x, s[i]);
    cnt1 += d[i];
    time += d[i];
    cnt2 += s[i];
    while (cnt1 > cnt2) {
      time += k;
      cnt2 += x;
    }
  }
  cout << time << endl;
  return 0;
}
