#include <bits/stdc++.h>
using namespace std;
int main() {
  long long day, k, inc, a, ans = 0;
  vector<long long> need;
  priority_queue<long long, vector<long long>, greater<long long>> price;
  cin >> day >> k;
  for (long long i = 0; i < day; i++) {
    cin >> a;
    need.push_back(a);
  }
  cin >> inc;
  int chk = 1;
  for (long long i = 0; i < day; i++) {
    cin >> a;
    price.push(a);
    while (price.size() > 0 && k < need[i]) {
      ans += price.top();
      k = k + inc;
      price.pop();
    }
    if (k < need[i]) chk = 0;
  }
  if (chk == 0)
    cout << "-1\n";
  else
    cout << ans << "\n";
}
