#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int n, m;
  long long int curr, A, ans = 0;
  scanf("%d", &n);
  scanf("%I64d", &curr);
  long long int weight[n], cost[n];
  for (i = 0; i < n; i++) scanf("%I64d", &weight[i]);
  scanf("%I64d", &A);
  for (i = 0; i < n; i++) scanf("%I64d", &cost[i]);
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      pq;
  for (i = 0; i < n; i++) {
    pq.push(cost[i]);
    while (curr < weight[i] && pq.size()) {
      curr += A;
      ans += pq.top();
      pq.pop();
    }
    if (curr < weight[i]) {
      printf("%d", -1);
      return 0;
    }
  }
  printf("%I64d", ans);
  return 0;
}
