#include <bits/stdc++.h>
using namespace std;
long long n, k, a, x[100007], c[100007], cnt = 0, ans = 0;
bool y = 1, w[100007];
priority_queue<long long, vector<long long>, greater<long long> > m;
int main() {
  memset(w, 0, sizeof(w));
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> x[i];
  cin >> a;
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n; i++) {
    m.push(c[i]);
    if (x[i] > k) {
      int num = (x[i] - k + a - 1) / a;
      cnt += num;
      k += num * a;
      if (cnt > i) {
        y = 0;
        break;
      }
      for (int j = 0; j < num; j++) {
        ans += m.top();
        m.pop();
      }
    }
  }
  if (y)
    cout << ans << endl;
  else
    cout << -1 << endl;
  return 0;
}
