#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int n, k;
int d[1005];
int s[1005];
bool vis[1005];
int main() {
  cin >> n >> k;
  for (int i = 0; i < int(n); i++) cin >> d[i];
  for (int i = 0; i < int(n); i++) cin >> s[i];
  int mx = 0;
  int bal = 0;
  int ans = 0;
  for (int i = 0; i < int(n); i++) {
    mx = max(mx, s[i]);
    bal += s[i];
    ans += d[i];
    bal -= d[i];
    while (bal < 0) {
      bal += mx;
      ans += k;
    }
  }
  cout << ans << endl;
  return 0;
}
