#include <bits/stdc++.h>
std::vector<int> X;
int main(void) {
  int n, k;
  scanf("%d%d", &n, &k);
  X.resize(n);
  for (int(i) = (0); (i) < (n); ++(i)) scanf("%d", &X[i]);
  int A;
  scanf("%d", &A);
  long long int res = 0;
  std::priority_queue<int, std::vector<int>, std::greater<int>> PQ;
  for (int(i) = (0); (i) < (n); ++(i)) {
    int c;
    scanf("%d", &c);
    PQ.push(c);
    while (k < X[i]) {
      if (PQ.empty()) {
        puts("-1");
        return 0;
      }
      res += PQ.top();
      PQ.pop();
      k += A;
    }
  }
  printf("%lld\n", res);
  return 0;
}
