#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> wts(n);
  for (auto &x : wts) cin >> x;
  long long a;
  cin >> a;
  vector<long long> prc(n);
  for (auto &x : prc) cin >> x;
  multiset<long long> ms;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ms.insert(prc[i]);
    if (k < wts[i]) {
      if (ms.empty()) {
        ans = -1;
        break;
      }
      while (k < wts[i]) {
        if (ms.empty()) {
          ans = -1;
          goto ext;
        }
        ans += *ms.begin();
        k += a;
        ms.erase(ms.begin());
      }
    }
  }
ext:
  cout << ans << endl;
  return 0;
}
