#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MAXM = 1000005;
const int MOD = 1000000007;
const int MAMOD = 998244353;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-8;
long long n, k, a;
long long x[MAXN], c[MAXN];
priority_queue<long long, vector<long long>, greater<long long>> pq;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  cin >> a;
  for (int i = 1; i <= n; ++i) cin >> c[i];
  long long sum = 0;
  bool ok = 1;
  for (int i = 1; i <= n; ++i) {
    pq.push(c[i]);
    while (k < x[i]) {
      if (pq.empty()) {
        ok = 0;
        break;
      }
      k += a;
      sum += pq.top();
      pq.pop();
    }
    if (!ok) break;
  }
  if (ok)
    cout << sum << "\n";
  else
    cout << -1 << "\n";
  return 0;
}
