#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long x[n];
  for (long long i = 0; i < n; i++) cin >> x[i];
  long long a;
  cin >> a;
  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;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    pq.push(c[i]);
    if (k >= x[i]) continue;
    long long take = (x[i] - k + a - 1) / a;
    if (take > pq.size()) return cout << "-1", 0;
    k += take * a;
    while (take-- > 0) ans += pq.top(), pq.pop();
  }
  cout << ans;
}
