#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 1 + 1e5;
long long n, a[MaxN], k, b[MaxN], x, kq;
priority_queue<long long, vector<long long>, greater<long long> > q;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  cin >> x;
  for (int i = 0; i < n; ++i) cin >> b[i];
  for (int i = 0; i < n; ++i) {
    q.push(b[i]);
    if (k + x * q.size() < a[i]) {
      cout << -1 << endl;
      return 0;
    }
    while (k < a[i]) {
      k += x;
      kq += q.top();
      q.pop();
    }
  }
  cout << kq << endl;
  return 0;
}
