#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, cur, a, ness, ans = 0, f = 0;
  cin >> n >> cur;
  vector<long long int> x(n), c(n);
  for (long long int i = 0; i < n; i++) cin >> x[i];
  cin >> a;
  for (long long int i = 0; i < n; i++) cin >> c[i];
  multiset<long long int> ms;
  for (long long int i = 0; i < n; i++) {
    ms.insert(c[i]);
    if (cur < x[i]) {
      ness = (x[i] - cur) / a;
      if ((x[i] - cur) % a != 0) ness++;
      if (ness <= ms.size()) {
        for (long long int j = 0; j < ness; j++) {
          ans += *(ms.begin());
          ms.erase(ms.begin());
        }
        cur += (ness * a);
      } else {
        f = 1;
        break;
      }
    }
  }
  if (f == 1)
    cout << -1 << "\n";
  else
    cout << ans << "\n";
}
