#include <bits/stdc++.h>
using namespace std;
long long target[200000], cost[200000];
priority_queue<int, vector<int>, greater<int> > heap;
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; ++i) {
    cin >> target[i];
  }
  long long a;
  cin >> a;
  for (long long i = 0; i < n; ++i) {
    cin >> cost[i];
  }
  long long max = 0;
  for (long long i = 1; i <= n; ++i) {
    if (k + (i * a) < target[i]) {
      printf("-1\n");
      return 0;
    }
  }
  long long curr = k, ans = 0;
  for (long long i = 1; i <= n; ++i) {
    heap.push(cost[i - 1]);
    while (curr < target[i]) {
      curr += a;
      ans += heap.top();
      heap.pop();
    }
  }
  cout << ans << endl;
  return 0;
}
