#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int arr[maxn];
int cost[maxn];
int main() {
  priority_queue<int, vector<int>, greater<int> > q;
  int n, k;
  int inpre;
  cin >> n >> k;
  long long int ans = 0;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  cin >> inpre;
  for (int i = 0; i < n; ++i) cin >> cost[i];
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    q.push(cost[i]);
    if (k < arr[i]) {
      while (!q.empty()) {
        k += inpre;
        ans += q.top();
        q.pop();
        if (k >= arr[i]) break;
      }
      if (k < arr[i]) flag = false;
    }
    if (flag == false) break;
  }
  if (flag)
    cout << ans << endl;
  else
    cout << -1 << endl;
  return 0;
}
