#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  int t = 1;
  while (t--) {
    long long sum = 0, diff, a, b, x, y, n, strength;
    cin >> n >> strength;
    long long *targets = new long long[n];
    for (int i = 0; i < n; i++) cin >> targets[i];
    cin >> a;
    long long *cost = new long long[n];
    for (int i = 0; i < n; i++) cin >> cost[i];
    long long ans = 0, preMin = INT_MAX;
    priority_queue<long long, vector<long long>, greater<long long> > pq;
    for (int i = 0; i < n; i++) {
      if (targets[i] <= strength) {
        pq.push(cost[i]);
      } else {
        pq.push(cost[i]);
        while (pq.empty() == false) {
          ans += pq.top();
          pq.pop();
          strength += a;
          if (strength >= targets[i]) break;
          if (pq.empty()) {
            cout << "-1";
            return 0;
          }
        }
      }
    }
    cout << ans;
    delete[] targets;
    delete[] cost;
  }
  return 0;
}
