#include <bits/stdc++.h>
using namespace std;
multiset<long long> ms;
long long x[100005], c[100005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, n, k, a, cur, ans;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> a;
  for (i = 0; i < n; i++) {
    cin >> c[i];
  }
  cur = k;
  ans = 0;
  for (i = 0; i < n; i++) {
    ms.insert(c[i]);
    while (cur < x[i] && !ms.empty()) {
      cur = cur + a;
      ans = ans + *ms.begin();
      ms.erase(ms.begin());
    }
    if (cur < x[i]) {
      ans = -1;
      break;
    }
  }
  cout << ans;
  return 0;
}
