#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> day(n);
  vector<long long int> cost(n);
  vector<long long int> cp;
  for (long long int i = 0; i < n; i++) cin >> day[i];
  long long int gain;
  long long int co = 0;
  cin >> gain;
  for (long long int i = 0; i < n; i++) {
    cin >> cost[i];
    vector<long long int>::iterator it;
    it = lower_bound(cp.begin(), cp.end(), cost[i]);
    cp.insert(it, cost[i]);
    while (k < day[i]) {
      long long int len = cp.size();
      if (len == 0) {
        cout << -1;
        return 0;
      }
      k = k + gain;
      co = co + cp[0];
      cp.erase(cp.begin());
    }
  }
  cout << co;
  return 0;
}
