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