#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long mxn = 4e5 + 5;
long long chk(long long a[], long long k, long long add, long long n) {
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    long long l = i + 1;
    if (a[i] > l * add + k) {
      return 1;
    }
  }
  return 0;
}
long long mainx() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long add;
  long long cost[n];
  cin >> add;
  for (long long i = 0; i < n; i++) cin >> cost[i];
  if (chk(a, k, add, n)) {
    cout << -1 << endl;
    return 0;
  }
  long long ans = 0;
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  for (long long i = 0; i < n; i++) {
    pq.push(cost[i]);
    if (a[i] > k) {
      while (k < a[i] and !pq.empty()) {
        k += add;
        ans += pq.top();
        pq.pop();
      }
    }
  }
  cout << ans << endl;
  return 0;
}
void inp();
int32_t main() {
  inp();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  long long t = 1;
  for (long long i = 0; i < t; i++) {
    mainx();
  }
  return 0;
}
void inp() {}
