#include <bits/stdc++.h>
using namespace std;
auto ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int_fast32_t MAXN = 1e5 + 7;
int_fast32_t n, k;
int_fast64_t p[MAXN], inc, A[MAXN];
int main() {
  ____();
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> A[i];
  cin >> inc;
  for (int i = 1; i <= n; i++) cin >> p[i];
  priority_queue<int, vector<int>, greater<int> > que;
  int_fast64_t tot_cost = 0;
  int_fast64_t arc = k;
  for (int i = 1; i <= n; i++) {
    que.push(p[i]);
    if (arc >= A[i])
      continue;
    else {
      while (arc < A[i]) {
        if (que.empty())
          return puts("-1"), 0;
        else {
          arc += inc;
          tot_cost += que.top();
          que.pop();
        }
      }
    }
  }
  cout << tot_cost << endl;
  return 0;
}
