#include <bits/stdc++.h>
using namespace std;
const int maxn = 10001;
int a[maxn], b[maxn];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  int ans = 0;
  int temp = 0;
  int gao = 0;
  for (int i = 1; i <= n; i++) {
    temp += b[i];
    if (gao < b[i]) gao = b[i];
    while (temp < a[i]) {
      temp += gao;
      ans += k;
    }
    temp -= a[i];
    ans += a[i];
  }
  cout << ans << endl;
  return 0;
}
