#include <bits/stdc++.h>
using namespace std;
long long arr[200001];
long long cost[200001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long a;
  cin >> a;
  for (long long i = 0; i < n; i++) {
    cin >> cost[i];
  }
  long long ans = 0;
  priority_queue<long long, vector<long long>, greater<long long> > q1;
  for (long long i = 0; i < n; i++) {
    q1.push(cost[i]);
    if (k >= arr[i]) {
      continue;
    } else {
      while (!q1.empty() && k < arr[i]) {
        k += a;
        ans += q1.top();
        q1.pop();
      }
      if (k < arr[i]) {
        cout << "-1";
        return 0;
      }
    }
  }
  cout << ans;
  return 0;
}
