#include <bits/stdc++.h>
int main() {
  int n, k;
  std::cin >> n >> k;
  long long x[100000];
  for (int i = 0; i < n; i++) std::cin >> x[i];
  long long a;
  std::cin >> a;
  long long c[100000];
  for (int i = 0; i < n; i++) std::cin >> c[i];
  long long cost = 0;
  std::multiset<long long> untakenC;
  for (int i = 0; i < n; i++) {
    untakenC.insert(c[i]);
    if (k >= x[i]) continue;
    while (untakenC.size() != 0 && x[i] > k) {
      cost += *untakenC.begin();
      k += a;
      untakenC.erase(untakenC.begin());
    }
    if (x[i] > k) {
      std::cout << -1 << "\n";
      return 0;
    }
  }
  std::cout << cost << "\n";
  return 0;
}
