#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, K, i, cost = 0;
  cin >> n >> K;
  long long int X[n];
  for (i = 0; i < n; i++) cin >> X[i];
  long long int A, C[n], flag = 1;
  cin >> A;
  for (i = 0; i < n; i++) cin >> C[i];
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      q;
  for (i = 0; i < n; i++) {
    q.push(C[i]);
    if (X[i] > K) {
      while (K < X[i] && !q.empty()) {
        cost += q.top();
        K += A;
        q.pop();
        if (K < X[i] && q.empty()) {
          flag = 0;
          break;
        }
      }
      if (flag == 0) break;
    }
  }
  if (flag == 0)
    cout << -1 << endl;
  else
    cout << cost << endl;
}
