#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long MAXN = 1e5 + 7;
const long long MAXM = 1e5 + 7;
const long long MOD = 1e9 + 7;
const double eps = 1e-6;
const double pi = acos(-1.0);
int a[MAXN], c[MAXN];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int v;
  scanf("%d", &v);
  priority_queue<int, vector<int>, greater<int>> pq;
  long long ans = 0;
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    pq.push(x);
    while (!pq.empty() && k < a[i]) {
      ans += pq.top();
      k += v;
      pq.pop();
    }
    if (k < a[i]) flag = false;
  }
  if (!flag) {
    printf("-1\n");
  } else
    printf("%lld\n", ans);
  return 0;
}
