#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (auto &i : a) cin >> i;
  long long drk;
  cin >> drk;
  vector<long long> c(n);
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  for (long long i = 0; i < n; i++) {
    cin >> c[i];
  }
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    pq.push(c[i]);
    if (k >= a[i]) {
      continue;
    } else {
      if (k + drk * pq.size() < a[i]) {
        cout << -1 << endl;
        return 0;
      } else {
        long long d = ceil((a[i] - k) / (drk * 1.0));
        k += d * drk;
        while (d--) {
          sum += pq.top();
          pq.pop();
        }
      }
    }
  }
  cout << sum << endl;
  return 0;
}
