#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, k, d[1111], s[1111], cur = 0, ans = 0;
  scanf("%d%d", &m, &k);
  for (int i = 0; i < m; i++) scanf("%d", &d[i]);
  for (int i = 0; i < m; i++) scanf("%d", &s[i]);
  for (int i = 0; i < m; i++) {
    cur += s[i];
    if (cur < d[i]) {
      int maxs = *max_element(s, s + i + 1);
      while (cur < d[i]) cur += maxs, ans += k;
    }
    cur -= d[i];
    ans += d[i];
  }
  printf("%d", ans);
  return 0;
}
