#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k, e, ans = 0;
  cin >> n >> k;
  multiset<long long> s;
  long long a[n + 1], c[n + 1];
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  cin >> e;
  for (long long int i = 1; i <= n; i++) cin >> c[i];
  for (long long int i = 1; i <= n; i++) {
    s.insert(c[i]);
    while (k < a[i] && s.size() != 0) {
      long long temp = *s.begin();
      k += e;
      ans += temp;
      s.erase(s.begin());
    }
    if (k < a[i]) return cout << "-1", 0;
  }
  cout << ans << "\n";
}
