#include <bits/stdc++.h>
using namespace std;
long long A, K, n, C[100100], X[100100];
void Docfile() {
  scanf("%lld%lld", &n, &K);
  for (int i = 1; i <= n; i++) scanf("%lld", &X[i]);
  scanf("%lld", &A);
  for (int i = 1; i <= n; i++) scanf("%lld", &C[i]);
}
void Xuli() {
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    pq.push(C[i]);
    if (K < X[i]) {
      long long tmp = (X[i] - K) / A + ((X[i] - K) % A != 0);
      if (pq.size() < tmp) {
        cout << -1;
        return;
      } else {
        K += tmp * A;
        while (tmp--) {
          res += pq.top();
          pq.pop();
        }
      }
    }
  }
  cout << res;
}
int main() {
  Docfile();
  Xuli();
}
