#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<long long> weights(n);
  priority_queue<long long, vector<long long>, greater<long long>> costs;
  map<long long, int> dups;
  for (int i = 0; i < n; i++) {
    cin >> weights[i];
  }
  long long A;
  cin >> A;
  int unuseddays = 0;
  long long minc = 0;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    costs.push(temp);
    if (weights[i] > k) {
      unuseddays += 1;
      while (weights[i] > k && unuseddays > 0) {
        minc += costs.top();
        long long temp = costs.top();
        k += A;
        costs.pop();
        unuseddays -= 1;
      }
      if (weights[i] > k) {
        minc = -1;
        break;
      }
    } else {
      unuseddays += 1;
    }
  }
  cout << minc << "\n";
  return 0;
}
