#include <bits/stdc++.h>
int const N = 200200;
int const SHIFT = 1e9 + 100;
long long const INFL = 1e18;
int const FIVE = 5;
long long b, c;
long long getCost(long long from, long long to) {
  long long diff = to - from;
  return diff / FIVE * b + diff % FIVE * c;
}
long long t[N];
long long BIG;
int main() {
  int n, k;
  scanf("%d%d%I64d%I64d", &n, &k, &b, &c);
  b = std::min(b, FIVE * c);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    t[i] = x + SHIFT;
  }
  std::sort(t, t + n);
  long long ans = INFL;
  for (int rem = 0; rem < FIVE; ++rem) {
    BIG = SHIFT * 2 + rem;
    std::multiset<std::pair<long long, long long>> values;
    long long sumCost = 0;
    int cur = -1;
    while (cur < k - 1) {
      ++cur;
      sumCost += getCost(t[cur], BIG);
      values.insert({-getCost(t[cur], BIG), t[cur]});
    }
    while (true) {
      long long realCost = sumCost - (long long)(BIG - t[cur]) / FIVE * b * k;
      ans = std::min(ans, realCost);
      if (cur + 1 < n) {
        ++cur;
        long long head = values.begin()->second;
        long long newSumCost =
            sumCost + getCost(t[cur], BIG) - getCost(head, BIG);
        if (newSumCost < sumCost) {
          sumCost = newSumCost;
          values.erase(values.begin());
          values.insert({-getCost(t[cur], BIG), t[cur]});
        }
      } else {
        break;
      }
    }
  }
  printf("%I64d\n", ans);
}
