#include <bits/stdc++.h>
long long n, k, a, sol;
long long demand[100005], costs[100005];
std::multiset<long long> set;
int main() {
  std::cin >> n >> k;
  for (long long i = 1; i <= n; ++i) std::cin >> demand[i];
  std::cin >> a;
  for (long long i = 1; i <= n; ++i) std::cin >> costs[i];
  for (long long i = 1; i <= n; ++i) {
    set.insert(costs[i]);
    long long need = demand[i] - k;
    if (need <= 0) continue;
    if (!(need % a))
      need /= a;
    else
      need = need / a + 1;
    if (need > set.size()) {
      std::cout << -1;
      return 0;
    } else {
      while (need--) {
        sol += *(set.begin());
        k += a;
        set.erase(set.begin());
      }
    }
  }
  std::cout << sol;
  return 0;
}
