#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 234;
int x[N], c[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int cnt = 0, n, k, a;
  long long ans = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a;
  for (int i = 0; i < n; i++) cin >> c[i];
  multiset<int> s;
  for (int i = 0; i < n; i++) {
    s.insert(c[i]);
    int need = (x[i] - k + a - 1) / a;
    while (cnt < need) {
      if (s.empty()) return cout << -1 << endl, 0;
      ans += *(s.begin());
      s.erase(s.begin());
      cnt++;
    }
  }
  cout << ans << endl;
  return 0;
}
