#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = pair<int, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vlli = vector<long long int>;
using vpii = vector<pair<int, int>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  lli n, k, a, x[100005], c[100005], money = 0;
  multiset<lli> unused;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> x[i];
  cin >> a;
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n; i++) {
    unused.insert(c[i]);
    while (!unused.empty() && k < x[i]) {
      auto temp = unused.begin();
      k += a;
      money += *temp;
      unused.erase(temp);
    }
    if (k < x[i]) return cout << -1, 0;
  }
  cout << money;
}
