#include <bits/stdc++.h>
using namespace std;
int dp[1010];
int lit[1010];
int add[1010];
int way[1010];
int main() {
  int m, k;
  while (~scanf("%d %d", &m, &k)) {
    way[0] = 0;
    for (int i = 1; i <= m; ++i) scanf("%d", &way[i]);
    for (int i = 0; i < m; ++i) scanf("%d", &add[i]);
    memset(dp, 9, sizeof(dp));
    lit[0] = add[0];
    dp[0] = 0;
    int Max = add[0];
    for (int i = 1; i < m + 1; ++i) {
      if (lit[i - 1] >= way[i]) {
        lit[i] = lit[i - 1] - way[i];
        dp[i] = dp[i - 1] + way[i];
      } else {
        int add_time = ceil((way[i] - lit[i - 1]) / (double)Max);
        lit[i] = lit[i - 1] + Max * add_time - way[i];
        dp[i] = dp[i - 1] + way[i] + add_time * k;
      }
      Max = max(add[i], Max);
      lit[i] += add[i];
    }
    printf("%d\n", dp[m]);
  }
}
