#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, gain;
  cin >> n >> k;
  vector<long long> lift(n);
  for (int i = 0; i < n; ++i) cin >> lift[i];
  cin >> gain;
  vector<long long> cost(n);
  for (int i = 0; i < n; ++i) cin >> cost[i];
  for (int i = 0; i < n; ++i) {
    lift[i] = max((i ? lift[i - 1] : 0LL), (lift[i] - k + gain - 1) / gain);
  }
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    if (lift[i] > i + 1) flag = false;
  }
  if (!flag) {
    cout << "-1" << '\n';
    return 0;
  }
  priority_queue<long long, vector<long long>, greater<long long>> costs;
  long long ans = 0, cnt = 0;
  for (int i = 0; i < n; ++i) {
    costs.push(cost[i]);
    while (cnt < lift[i]) {
      ans += costs.top();
      costs.pop();
      ++cnt;
    }
  }
  cout << ans << '\n';
  return 0;
}
