#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > Q;
const int INF = 1e9 + 9;
long int pow(long int a, long int b, int m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, a;
  cin >> n >> k;
  long long x[n + 5];
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> a;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long c;
    cin >> c;
    Q.push(c);
    while (k < x[i]) {
      if (Q.empty()) {
        cout << "-1";
        return 0;
      } else {
        k += a;
        sum += Q.top();
        Q.pop();
      }
    }
  }
  cout << sum;
}
