#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int d[N];
int s[N];
int main() {
  int m, k;
  scanf("%d%d", &m, &k);
  for (int i = 0; i < int(m); i++) scanf("%d", &d[i]);
  for (int i = 0; i < int(m); i++) scanf("%d", &s[i]);
  int tank = 0, mx = 0, time = 0;
  for (int i = 0; i < int(m); i++) {
    tank += s[i];
    mx = max(mx, s[i]);
    if (tank < d[i]) {
      int x = ceil(double(d[i] - tank) / double(mx));
      tank += x * mx;
      time += x * k;
    }
    time += d[i];
    tank -= d[i];
  }
  printf("%d\n", time);
  return 0;
}
