#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, k, num;
long long A[200005], B[200005], C[200005], D[200005];
long long sum, a, b, w, ans, c;
priority_queue<long long> Q;
int main() {
  scanf("%d %d %I64d %I64d", &n, &z, &b, &c);
  for (int i = (1); i <= (n); i++) scanf("%I64d", &A[i]);
  sort(A + 1, A + n + 1);
  for (int i = (2); i <= (n); i++) A[i] -= A[1];
  A[1] = 0ll;
  b = min(b, 5 * c);
  ans = -1ll;
  for (int l = (0); l < (5); l++) {
    for (int i = (1); i <= (n); i++) {
      B[i] = A[i] % 5ll - (long long)l;
      if (B[i] < 0ll) B[i] += 5ll;
      B[i] = 5ll - B[i];
      if (B[i] == 5) {
        B[i] = A[i];
        C[i] = 0ll;
      } else {
        C[i] = c * B[i];
        B[i] += A[i];
      }
    }
    for (int i = (2); i <= (n); i++) C[i] -= b * ((B[i] - B[1]) / 5ll);
    D[1] = B[1];
    k = 1;
    for (int i = (2); i <= (n); i++)
      if (B[i] != D[k]) {
        k++;
        D[k] = B[i];
      }
    x = 1;
    num = 0;
    sum = 0ll;
    while (!Q.empty()) Q.pop();
    for (int i = (1); i <= (k); i++) {
      while (B[x] <= D[i] && x <= n) {
        sum += C[x];
        Q.push(C[x]);
        x++;
        num++;
      }
      while (num > z) {
        sum -= Q.top();
        Q.pop();
        num--;
      }
      if (num == z) {
        if (ans == -1ll) ans = sum + b * (long long)(z) * ((D[i] - B[1]) / 5ll);
        ans = min(ans, sum + b * (long long)(z) * ((D[i] - B[1]) / 5ll));
      }
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
