#include <bits/stdc++.h>
using namespace std;
const int N = 100007;
int price[N];
int gram[N];
int day, det, fir;
int cnt;
long long ans;
int main() {
  scanf("%d%d", &day, &fir);
  for (int i = 0; i < day; ++i) {
    scanf("%d", &gram[i]);
    gram[i] = gram[i] - fir;
  }
  scanf("%d", &det);
  for (int i = 0; i < day; ++i) {
    gram[i] += (det - 1);
    gram[i] /= det;
  }
  for (int i = 0; i < day; ++i) {
    scanf("%d", &price[i]);
  }
  for (int i = 0; i < day; ++i) {
    if (cnt < gram[i]) {
      if (gram[i] > i + 1) {
        printf("-1\n");
        return 0;
      }
      sort(price + cnt, price + i + 1);
      for (int j = cnt; j < gram[i]; ++j) {
        ans += price[j];
      }
      cnt = gram[i];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
