#include <bits/stdc++.h>
using namespace std;
const long long MAX = 100001;
long long n, k, l[MAX], inf = 1000000000000;
multiset<long long> kek;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> l[i + 1];
  }
  long long a;
  cin >> a;
  long long ans = 0;
  kek.insert(inf);
  for (int i = 1; i <= n; i++) {
    long long b;
    cin >> b;
    kek.insert(b);
    while (k < l[i]) {
      if (*(kek.begin()) == inf) {
        cout << -1;
        return 0;
      }
      long long take = *(kek.begin());
      kek.erase(kek.find(take));
      k += a;
      ans += take;
    }
  }
  cout << ans;
  return 0;
}
