#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, performance;
  long long cost = 0;
  long long k;
  cin >> n >> k;
  int x[n], c[n];
  for (int& e : x) cin >> e;
  cin >> performance;
  for (int& e : c) cin >> e;
  priority_queue<int, vector<int>, greater<int>> rem;
  int i = 0;
  for (int e : x) {
    rem.push(c[i++]);
    while (k < e) {
      if (rem.empty()) {
        cout << "-1\n";
        return 0;
      }
      k += performance, cost += rem.top(), rem.pop();
    }
  }
  cout << cost << '\n';
  return 0;
}
