#include <bits/stdc++.h>
using namespace std;
const int N = 1003;
int d[N], s[N];
int main() {
  int m, k;
  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 maxidx = 0, cur = 0, t = 0;
  for (int i = 0; i < m; ++i) {
    if (s[i] > s[maxidx]) maxidx = i;
    cur += s[i];
    if (cur < d[i]) {
      int supply = (d[i] - cur) / s[maxidx] * s[maxidx];
      supply += (cur + supply < d[i]) * s[maxidx];
      t += supply / s[maxidx] * k;
      cur += supply;
    }
    cur -= d[i];
    t += d[i];
  }
  printf("%d\n", t);
}
