#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a;
  cin >> n >> k;
  long long x[n], c[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a;
  for (int i = 0; i < n; i++) cin >> c[i];
  priority_queue<long long> pq;
  long long cost = 0;
  bool possible = true;
  for (int i = 0; i < n; i++) {
    pq.push(1e9 - c[i]);
    while (!pq.empty() && k < x[i]) {
      cost += -(pq.top() - 1e9);
      pq.pop();
      k += a;
    }
    if (k < x[i]) {
      possible = false;
      i = n + 1;
    }
  }
  if (possible)
    cout << cost << endl;
  else
    cout << -1 << endl;
  return 0;
}
