#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 6;
long long X[MAX], C[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long N, K;
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    cin >> X[i];
  }
  long long A;
  cin >> A;
  for (int i = 1; i <= N; i++) {
    cin >> C[i];
  }
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  long long cur = K, cost = 0;
  for (int i = 1; i <= N; i++) {
    pq.push(C[i]);
    while (cur < X[i]) {
      if (pq.empty()) return cout << "-1", 0;
      cur += A;
      cost += pq.top();
      pq.pop();
    }
  }
  cout << cost;
}
