#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int inf = 1e9 + 1;
const int prime_100000000 = 5761460;
const double eps = 1e-15;
const double EPS = 1e-9;
const double PI = acos(-1.0);
long long powmod(long long a, long long b, long long MOD) {
  long long ans = 1;
  while (b) {
    if (b % 2) ans = ans * a % MOD;
    a = a * a % MOD;
    b /= 2;
  }
  return ans;
}
long long GCD(long long x, long long y) {
  if (x % y == 0)
    return y;
  else
    return (GCD(y, x % y));
}
const long long mod = 1e9 + 7;
const int mx = 1e5 + 7;
int main() {
  long long n, k, a, x[mx], c[mx], res = 0;
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  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++) {
    if (x[i] <= k) {
      pq.push(c[i]);
    } else {
      pq.push(c[i]);
      while (!pq.empty()) {
        long long top_element = pq.top();
        pq.pop();
        res += top_element;
        k += a;
        if (k >= x[i]) break;
      }
      if (k < x[i]) {
        res = -1;
        break;
      }
    }
  }
  cout << res << endl;
  return 0;
}
