#include <bits/stdc++.h>
using namespace std;
long long n, s, a[100005], p, w[100005], ans;
multiset<long long> st;
int main() {
  cin >> n >> s;
  for (int k = 1; k <= n; k++) cin >> a[k];
  cin >> p;
  for (int k = 1; k <= n; k++) cin >> w[k];
  for (int k = 1; k <= n; k++) {
    st.insert(w[k]);
    while (s < a[k]) {
      if (st.size() == 0) {
        cout << -1;
        return 0;
      }
      ans += *st.begin();
      st.erase(st.begin());
      s += p;
    }
  }
  cout << ans;
  return 0;
}
