#include <bits/stdc++.h>
using namespace std;
long long n, k, x[100001], a, c[100001];
int main(int argc, char const *argv[]) {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> x[i];
  cin >> a;
  for (int i = 1; i <= n; i++) cin >> c[i];
  set<long long> s;
  set<long long>::iterator it;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    s.insert(c[i]);
    it = s.begin();
    while (k < x[i] && !s.empty()) {
      k += a;
      ans += *it;
      it = s.erase(it);
    }
    if (k < x[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << ans;
  return 0;
}
