#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  set<long long> ss;
  vector<long long> aa(n);
  for (int i = 0; i < n; i++) cin >> aa[i];
  long long A;
  cin >> A;
  vector<int> cc(n);
  for (int i = 0; i < n; i++) cin >> cc[i];
  long long v = k;
  long long u = 0;
  ss.clear();
  bool ff = false;
  for (int i = 0; i < n && !ff; i++) {
    ss.insert(cc[i]);
    if (v >= aa[i])
      continue;
    else {
      while (v < aa[i] && !ss.empty()) {
        v += A;
        u += *ss.begin();
        ss.erase(ss.begin());
      }
      if (v < aa[i]) ff = true;
    }
  }
  if (ff)
    cout << -1 << "\n";
  else
    cout << u << "\n";
  return 0;
}
