#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) {
    long long n, k, g;
    cin >> n >> k;
    long long aa[n], cost[n];
    for (long long i = 0; i < n; i++) cin >> aa[i];
    cin >> g;
    for (long long i = 0; i < n; i++) cin >> cost[i];
    map<long long, long long> hehe;
    set<long long> heh;
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      heh.insert(cost[i]);
      hehe[cost[i]]++;
      if (k >= aa[i]) continue;
      while (k < aa[i]) {
        if (heh.size() == 0) {
          cout << "-1"
               << "\n";
          return 0;
        }
        k += g;
        ans += *heh.begin();
        hehe[*heh.begin()]--;
        if (hehe[*heh.begin()] == 0) heh.erase(*heh.begin());
      }
    }
    cout << ans << "\n";
  }
}
