#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, K, A;
  cin >> N >> K;
  vector<long> X(N);
  for (long &x : X) cin >> x;
  cin >> A;
  vector<long> C(N);
  for (long &x : C) cin >> x;
  long long Answer = 0;
  priority_queue<long, vector<long>, greater<long>> HEAP;
  for (long i = 0; i < N; ++i) {
    HEAP.push(C[i]);
    while (K < X[i]) {
      if (HEAP.empty()) {
        cout << -1 << endl;
        return 0;
      }
      K += A;
      Answer += HEAP.top();
      HEAP.pop();
    }
  }
  cout << Answer << endl;
}
