#include <bits/stdc++.h>
using namespace std;
int a[1001];
int s[1001];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
  }
  int ans = 0;
  int remain = 0;
  int max_fuel = 0;
  for (int i = 1; i <= n; i++) {
    remain += s[i];
    max_fuel = max(max_fuel, s[i]);
    while (remain < a[i]) {
      remain += max_fuel;
      ans += k;
    }
    remain -= a[i];
    ans += a[i];
  }
  printf("%d", ans);
  return 0;
}
