#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[100500], c[100500];
  priority_queue<long long int> q;
  int n, a, k;
  long long int sum = 0;
  cin >> n;
  cin >> k;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> a;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    q.push(-1 * c[i]);
    while ((!q.empty()) && k < x[i]) {
      sum = sum - q.top();
      q.pop();
      k = k + a;
    }
    if (k < x[i]) {
      cout << "-1";
      return 0;
    }
  }
  cout << sum;
  return 0;
}
