#include <bits/stdc++.h>
using namespace std;
vector<long long int> v, cost;
int main() {
  long long int n, k;
  scanf("%lld%lld", &n, &k);
  for (long long int i = 0; i < n; i++) {
    long long int a;
    scanf("%lld", &a);
    v.push_back(a);
  }
  long long int gain;
  cin >> gain;
  for (long long int i = 0; i < n; i++) {
    long long int a;
    scanf("%lld", &a);
    cost.push_back(a);
  }
  priority_queue<long long int> pq;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    long long int a = cost[i] * (-1);
    pq.push(a);
    while (!pq.empty()) {
      if (k >= v[i]) break;
      long long int b = pq.top() * (-1);
      pq.pop();
      ans += b;
      k += gain;
    }
    if (k < v[i]) {
      cout << "-1" << endl;
      return 0;
    }
  }
  cout << ans << endl;
}
