#include <bits/stdc++.h>
using namespace std;
const int MAX = 1010;
const int INF = 1 << 28;
const double EPS = 1e-7;
int M, K;
int s[MAX], d[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin >> M >> K;
  for (int i = 1; i <= (M); ++i) cin >> d[i];
  for (int i = 1; i <= (M); ++i) cin >> s[i];
  int t = 0;
  int bst = 1;
  int fuel = 0;
  for (int i = 1; i <= (M); ++i) {
    if (s[i] > s[bst]) bst = i;
    fuel += s[i];
    int rest = d[i] - fuel;
    int wait = 0;
    if (rest > 0) {
      wait = rest / s[bst];
      if (rest % s[bst]) ++wait;
    }
    t += wait * K + d[i];
    fuel = fuel + wait * s[bst] - d[i];
  }
  cout << t << endl;
  return 0;
}
