#include <bits/stdc++.h>
using namespace std;
unsigned long long mod = 1e9 + 7;
bool prime(unsigned long long num) {
  bool flag = true;
  for (unsigned long long i = 2; i * i <= num; i++) {
    if (num % i == 0) {
      flag = false;
      break;
    }
  }
  return flag;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, k;
  cin >> n >> k;
  long long x[n], a, c[n], p = k;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> a;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  multiset<long long> sm;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    sm.insert(c[i]);
    if (x[i] > p) {
      while (p < x[i]) {
        multiset<long long>::iterator it = sm.begin();
        if (it == sm.end()) {
          cout << "-1";
          return 0;
        }
        p += a;
        ans += *it;
        sm.erase(it);
      }
    }
  }
  cout << ans;
  return 0;
}
