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