#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long long inc;
  cin >> inc;
  long long cost[n];
  for (int i = 0; i < n; i++) cin >> cost[i];
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    pq.push(cost[i]);
    while (k < arr[i]) {
      if (pq.empty()) {
        cout << -1;
        return 0;
      }
      k += inc;
      ans += pq.top();
      pq.pop();
    }
  }
  cout << ans;
}
