#include <bits/stdc++.h>
using namespace std;
const int L = 1001;
int main() {
  int a[L], b[L], i, j, m, k, va;
  while (~scanf("%d %d", &m, &k)) {
    int hour = 0, sum;
    for (i = 0; i < m; i++) scanf("%d", &a[i]);
    for (i = 0; i < m; i++) scanf("%d", &b[i]);
    sum = 0;
    va = b[0];
    for (i = 0; i < m; i++) {
      va = max(b[i], va);
      sum += b[i];
      while (a[i] > sum) {
        sum += va;
        hour += k;
      }
      hour += a[i];
      sum -= a[i];
    }
    printf("%d\n", hour);
  }
  return 0;
}
