#include <bits/stdc++.h>
using namespace std;
struct classcomp {
  bool operator()(const int& lhs, const int& rhs) const { return lhs < rhs; }
};
int gcd(long long x, long long y) { return (y == 0) ? x : gcd(y, x % y); }
string convertint(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
bool first(pair<int, int> p1, pair<int, int> p2) {
  return p1.first + p1.second > p2.first + p2.second;
}
bool ff(int a, int b) { return a > b; }
int d[10005];
int second[10005];
int p[10005];
int mx[10005];
int main(void) {
  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", &second[i]);
  long long t = 0;
  long long first = 0;
  mx[0] = second[0];
  for (int i = 1; i < m; i++) mx[i] = max(second[i], mx[i - 1]);
  for (int i = 0; i < m; i++) {
    first += second[i];
    while (first < d[i]) {
      t += k;
      first += mx[i];
    }
    first -= d[i];
    t += d[i];
  }
  cout << t << endl;
  return 0;
}
