#include <bits/stdc++.h>
using namespace std;
inline int read(void) {
  register int x = 0, f = 1, ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
priority_queue<int, vector<int>, greater<int> > q;
const int maxn = 100005;
int n, k, each, x[maxn], c[maxn];
long long ans;
int main(void) {
  n = read();
  k = read();
  for (register int i = 1; i <= n; ++i) x[i] = read();
  each = read();
  for (register int i = 1; i <= n; ++i) c[i] = read();
  for (register int i = 1; i <= n; ++i) {
    q.push(c[i]);
    while (1) {
      if (k >= x[i]) break;
      if (q.empty()) break;
      ans += q.top();
      q.pop();
      k += each;
    }
    if (k < x[i]) {
      printf("-1\n");
      return 0;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
