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