#include <bits/stdc++.h>
using namespace std;
int n, k, A;
long long cost;
int x[100010];
long long c[100010];
priority_queue<long long, vector<long long>, greater<long long> > q;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  scanf("%d", &A);
  for (int i = 1; i <= n; i++) scanf("%I64d", &c[i]);
  for (int i = 1; i <= n; i++) {
    q.push(c[i]);
    while (q.size() && k < x[i]) {
      cost += q.top();
      q.pop();
      k += A;
    }
    if (k < x[i]) {
      cost = -1;
      break;
    }
  }
  cout << cost;
  return 0;
}
