#include <bits/stdc++.h>
using namespace std;
int t = 1;
vector<long long int> a, b;
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> x(n), c(n);
  for (long long int i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long int A;
  cin >> A;
  for (long long int i = 0; i < n; i++) {
    cin >> c[i];
  }
  priority_queue<int, vector<int>, greater<int> > pq;
  long long int initial = k, ans = 0;
  for (long long int i = 0; i < n; i++) {
    pq.push(c[i]);
    while (!pq.empty() && initial < x[i]) {
      initial += A;
      ans += pq.top();
      pq.pop();
    }
    if (initial < x[i]) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
}
