#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll n, lift;
  cin >> n >> lift;
  vector<ll> wanna(n);
  ll mx = 0;
  for (int i = 0; i < n; ++i) {
    cin >> wanna[i];
    mx = max(mx, wanna[i]);
  }
  ll boost;
  cin >> boost;
  vector<ll> cost(n);
  for (int i = 0; i < n; ++i) {
    cin >> cost[i];
  }
  int parbe = true;
  vector<ll> now;
  ll tk = 0;
  for (int i = 0; i < n; ++i) {
    now.push_back(cost[i]);
    if (lift < wanna[i]) {
      if (now.size() * boost + lift < wanna[i]) {
        parbe = false;
        break;
      } else {
        sort(now.begin(), now.end());
        reverse(now.begin(), now.end());
        while (lift < wanna[i]) {
          lift += boost;
          tk += now.back();
          now.pop_back();
        }
      }
    }
    if (lift >= mx) break;
  }
  if (!parbe)
    cout << "-1" << endl;
  else
    cout << tk << endl;
  return 0;
}
