#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
int n, k, X[MAX_N], a, C[MAX_N];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> X[i];
  cin >> a;
  for (int i = 1; i <= n; i++) cin >> C[i];
  set<int> S;
  long long result = 0;
  for (int i = 1; i <= n; i++) {
    S.insert(C[i]);
    while (k < X[i] && S.size() > 0) {
      k += a;
      result += *(S.begin());
      S.erase(S.begin());
    }
    if (k < X[i]) {
      cout << "-1";
      return 0;
    }
  }
  cout << result;
  return 0;
}
