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