#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
int N, K, A;
long long arr[100013];
long long cost[100013];
priority_queue<long long, vector<long long>, greater<long long> > pq;
long long ans;
int taken;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  for (auto i = (0); i < (N); i++) {
    cin >> arr[i];
  }
  cin >> A;
  for (auto i = (0); i < (N); i++) {
    cin >> cost[i];
  }
  for (auto i = (0); i < (N); i++) {
    arr[i] = (arr[i] - K + A - 1) / A;
  }
  for (auto i = (0); i < (N); i++) {
    pq.push(cost[i]);
    while (taken < arr[i]) {
      if (pq.empty()) {
        cout << "-1\n";
        return 0;
      }
      taken++;
      ans += pq.top();
      pq.pop();
    }
  }
  cout << ans << '\n';
  return 0;
}
