#include <bits/stdc++.h>
using namespace std;
long long x[200005];
long long c[200005];
void solve(long long tc) {
  long long a, n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> x[i];
  cin >> a;
  for (long long i = 1; i <= n; i++) cin >> c[i];
  long long ans = 0;
  multiset<long long> costs;
  long long tot_avail = 0;
  for (long long i = 1; i <= n; i++) {
    costs.insert(c[i]);
    tot_avail += a;
    long long req = max(0ll, x[i] - k);
    if (req > tot_avail) {
      cout << -1;
      return;
    }
    while (x[i] > k) {
      k += a;
      ans += (*costs.begin());
      tot_avail -= a;
      costs.erase(costs.begin());
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long t = 1;
  long long tc = 1;
  while (t--) {
    solve(tc);
    tc++;
  }
}
