#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  long long int ar[n], req[n], a, c[n];
  for (long long int i = 0; i < n; i++) cin >> ar[i];
  cin >> a;
  for (long long int i = 0; i < n; i++) cin >> c[i];
  for (long long int i = 0; i < n; i++) {
    long long int z = 0;
    if (ar[i] > k) z = (ar[i] - k) / a + ((ar[i] - k) % a != 0);
    req[i] = z;
  }
  long long int ans = 0, drink = 0;
  bool f = true;
  priority_queue<long long int, vector<long long int>, greater<long long int> >
      q;
  for (long long int i = 0; i < n; i++) {
    q.push(c[i]);
    if (req[i] > drink) {
      long long int z = req[i] - drink;
      if (z > q.size()) {
        f = false;
        break;
      } else {
        while (z--) {
          ans = ans + q.top();
          drink++;
          q.pop();
        }
      }
    }
    if (f == false) break;
  }
  if (f)
    cout << ans;
  else
    cout << -1;
}
