#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2) return x * power(x * x, (n - 1) / 2);
  return power(x * x, n / 2);
}
long long int powerm(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2)
    return (x * powerm((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
  return powerm((x * x) % 1000000007, n / 2);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int N, K;
  cin >> N >> K;
  int X[N];
  for (int i = 0; i < N; i++) cin >> X[i];
  int A;
  cin >> A;
  int C[N];
  for (int i = 0; i < N; i++) cin >> C[i];
  priority_queue<int> pq;
  long long int ans = 0;
  for (int i = 0; i < N; i++) {
    pq.push(-C[i]);
    while (!pq.empty() and K < X[i]) {
      K += A;
      ans -= pq.top();
      pq.pop();
    }
    if (K < X[i]) {
      return cout << -1, 0;
    }
  }
  cout << ans;
  return 0;
}
