#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
const long long INF = 1000000000000000LL;
long long n, k, x[MAX_N], a, c[MAX_N];
set<long long> s;
long long ans;
int main() {
  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];
  for (int i = 0; i < n; i++) {
    s.insert(c[i]);
    if (k >= x[i]) continue;
    long long p = x[i] - k;
    if (p % a == 0)
      p /= a;
    else {
      p /= a;
      p++;
    }
    if (p > s.size()) {
      cout << -1 << endl;
      return 0;
    }
    while (p > 0) {
      ans += *s.begin();
      s.erase(s.begin());
      p--;
      k += a;
    }
  }
  cout << ans << endl;
}
