#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> x(n);
  for (long long i = 0; i < n; i++) cin >> x[i];
  long long a;
  cin >> a;
  vector<long long> c(n);
  for (long long i = 0; i < n; i++) cin >> c[i];
  long long cost = 0;
  long long curr = k;
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  for (long long i = 0; i < n; i++) {
    pq.push(c[i]);
    if (x[i] - k > ((long long)(pq.size())) * a) {
      cout << -1 << endl;
      return 0;
    }
    for (long long j = 0; j < ceil(1.0 * (x[i] - curr) / a); j++) {
      cost += pq.top();
      pq.pop();
      k += a;
    }
    curr = k;
  }
  cout << cost << endl;
}
