#include <bits/stdc++.h>
const int maxn = 1001;
using namespace std;
int main(int argc, char **argv) {
  FILE *fp;
  fp = fopen("//home//mazhar//Desktop//in.txt", "r");
  if (fp != NULL) freopen("//home//mazhar//Desktop//in.txt", "r", stdin);
  int m, k, d[maxn], s[maxn];
  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);
  int fuel, city, tim, maxi;
  city = 0;
  fuel = s[0];
  maxi = s[0];
  tim = 0;
  while (city < m) {
    if (fuel < d[city]) {
      int K = (d[city] - fuel + maxi - 1) / maxi;
      tim += (k * K);
      fuel += (K * maxi);
    }
    tim += d[city];
    fuel -= d[city];
    city++;
    maxi = max(maxi, s[city]);
    fuel += (s[city]);
  }
  cout << tim << "\n";
  return 0;
}
