#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a;
  cin >> n >> k;
  vector<int> x(n);
  vector<int> cost(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a;
  for (int i = 0; i < n; i++) cin >> cost[i];
  long long curr = k;
  multiset<long long> s;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    s.insert(cost[i]);
    while (curr < x[i] && !s.empty()) {
      long long add = *s.begin();
      sum = sum + add;
      s.erase(add);
      curr = curr + a;
    }
    if (curr < x[i]) {
      cout << -1 << "\n";
      return 0;
    }
  }
  cout << sum << "\n";
  return 0;
}
