#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
long long x[100005], c[100005];
priority_queue<long long, vector<long long>, greater<long long> > q;
int main() {
  int n;
  long long k, a;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);
  cin >> a;
  for (int i = 1; i <= n; i++) scanf("%lld", &c[i]);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    q.push(c[i]);
    if (x[i] <= k) continue;
    long long b = x[i] - k;
    int cnt = ((b + a - 1) / a);
    if (cnt > q.size()) {
      cout << -1 << endl;
      return 0;
    }
    k += cnt * a;
    while (cnt--) {
      ans += q.top();
      q.pop();
    }
  }
  cout << ans << endl;
  return 0;
}
