#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a[n + 5], i;
  for (i = 1; i <= n; i++) cin >> a[i];
  long long x;
  cin >> x;
  long long c[n + 5];
  for (i = 1; i <= n; i++) cin >> c[i];
  priority_queue<long long, vector<long long>, greater<long long> > pq;
  long long maxi = k;
  long long ans = 0;
  for (i = 1; i <= n; i++) {
    pq.push(c[i]);
    if (a[i] > maxi) {
      long long sz = pq.size();
      if (maxi + x * sz < a[i]) {
        cout << -1;
        return 0;
      }
      while (maxi < a[i]) {
        ans += pq.top();
        pq.pop();
        maxi += x;
      }
    }
  }
  cout << ans;
  return 0;
}
