#include <bits/stdc++.h>
using namespace std;
int static fast = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();
int main() {
  int n;
  long long power, power_up;
  cin >> n >> power;
  vector<int> target(n, 0);
  vector<int> cost(n, 0);
  for (int& val : target) cin >> val;
  cin >> power_up;
  for (int& c : cost) cin >> c;
  long long ans = 0;
  priority_queue<int, vector<int>, greater<int>> pq;
  for (int i = 0; i < n; i++) {
    pq.push(cost[i]);
    while (power < target[i]) {
      if (pq.empty()) {
        cout << -1 << endl;
        return 0;
      }
      power += power_up;
      ans += pq.top();
      pq.pop();
    }
  }
  cout << ans << endl;
  return 0;
}
