#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int x[N], c[N];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> x[i];
  int a;
  cin >> a;
  priority_queue<int> q;
  for (int i = 0; i < n; ++i) cin >> c[i];
  long long ans = 0;
  long long v = k;
  for (int i = 0; i < n; ++i) {
    q.push(c[i] * -1);
    while (v < x[i] && !q.empty()) {
      ans += q.top() * -1;
      v += a;
      q.pop();
    }
    if (v < x[i]) return cout << "-1", 0;
  }
  cout << ans;
}
