#include <bits/stdc++.h>
using namespace std;
unsigned long long fast_exp(unsigned long long base, unsigned long long exp) {
  unsigned long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base);
    base = (base * base);
    exp /= 2;
  }
  return res;
}
int main() {
  long long n, k, a, div, rem, tcost = 0, counter = 0, temp;
  set<long long> s;
  vector<long long> avail;
  cin >> n >> k;
  vector<long long> x;
  vector<long long> c;
  for (long long i = 0; i < n; i++) {
    cin >> temp;
    x.push_back(temp);
  }
  cin >> a;
  for (long long i = 0; i < n; i++) {
    cin >> temp;
    c.push_back(temp);
  }
  for (long long i = 0; i < n; i++) {
    s.insert(c[i]);
    avail.push_back(k + (i + 1) * a - (counter * a));
    if ((avail[i] - x[i]) < 0) {
      cout << "-1" << endl;
      return 0;
    } else {
      if (x[i] - k > 0) {
        div = (x[i] - k) / a;
        rem = (x[i] - k) % a;
        if (rem > 0) div += 1;
        counter += div;
        k += (div * a);
        while (div--) {
          tcost += *s.begin();
          s.erase(s.begin());
        }
      }
    }
  }
  cout << tcost << endl;
  return 0;
}
