#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  ll K;
  cin >> n >> K;
  vector<ll> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  ll a;
  cin >> a;
  vector<ll> c(n);
  for (int i = 0; i < n; i++) cin >> c[i];
  priority_queue<ll, vector<ll>, greater<ll> > pq;
  ll ans = 0;
  for (int i = 0; i < n; i++) {
    pq.push(c[i]);
    while (K < x[i] && !pq.empty()) {
      ll cost = pq.top();
      pq.pop();
      K += a;
      ans += cost;
    }
    if (K < x[i]) {
      cout << -1 << "\n";
      return 0;
    }
  }
  cout << ans << "\n";
  return 0;
}
