#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  long long c[100009];
  long long arr[100009];
  while (cin >> n >> k) {
    for (int i = 1; i <= n; i++) {
      cin >> arr[i];
    }
    long long boost;
    cin >> boost;
    c[0] = 0;
    for (int i = 1; i <= n; i++) {
      int v;
      cin >> c[i];
    }
    int lastTaken = 0;
    long long cost = 0;
    set<long long> st;
    for (int i = 1; i <= n; i++) {
      st.insert(c[i]);
      if (arr[i] > k) {
        long long req = (arr[i] - k) / boost;
        if ((arr[i] - k) % boost) {
          req++;
        }
        set<long long>::iterator itr1 = st.begin();
        set<long long>::iterator itr2 = st.end();
        while (itr1 != itr2) {
          cost += *itr1;
          k += boost;
          st.erase(st.find(*itr1));
          itr1 = st.begin();
          --req;
          if (req == 0) break;
        }
        if (req > 0) {
          cost = -1;
          break;
        }
      }
    }
    cout << cost << endl;
  }
}
