#include <bits/stdc++.h>
using namespace std;
const int MAX = 1005;
int N, K, D[MAX], S[MAX];
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 0; i < (int)N; i++) scanf("%d", &D[i]);
  for (int i = 0; i < (int)N; i++) scanf("%d", &S[i]);
  int res = 0;
  int lho = S[0];
  int pos = 0;
  int fuel = 0;
  while (pos != N) {
    if (lho < S[pos]) lho = S[pos];
    fuel += S[pos];
    int rem = max(0, D[pos] - fuel);
    int add = (rem + lho - 1) / lho;
    res += add * K;
    fuel += add * lho;
    fuel -= D[pos];
    res += D[pos];
    pos++;
  }
  printf("%d\n", res);
}
