#include <bits/stdc++.h>
using namespace std;
long long int A, N, K, C[100010], X[100010];
int main() {
  priority_queue<long long int> Q;
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  cin >> A;
  for (int i = 0; i < N; i++) {
    cin >> C[i];
  }
  long long int pase = K, res = 0;
  for (int i = 0; i < N; i++) {
    Q.push(-1 * C[i]);
    if (pase < X[i]) {
      while (pase < X[i] && !Q.empty()) {
        pase += A;
        res += -1 * Q.top();
        Q.pop();
      }
      if (pase < X[i]) {
        res = -1;
        break;
      }
    }
  }
  cout << res << endl;
  return 0;
}
