#define ll long long #define INF 2147483647 #define int long long
intinp(){ char c = getchar(); int neg = 1; while(c < '0' || c > '9'){ if(c == '-') neg = -1; c = getchar(); } int sum = 0; while(c >= '0' && c <= '9'){ sum = sum * 10 + c - '0'; c = getchar(); } return neg * sum; }
int pos[100010]; int n, k, a, b;
intsolve(int l, int r){ int cnt = std::upper_bound(pos + 1, pos + k + 1, r) - std::lower_bound(pos + 1, pos + k + 1, l); // printf("cnt [%d, %d] = %d\n", l, r, cnt); int mid = (l + r) >> 1; if(l == r && cnt != 0) return (r - l + 1) * cnt * b; return (cnt == 0) ? a : std::min((r - l + 1) * cnt * b, solve(l, mid) + solve(mid + 1, r)); }
signedmain(){ n = inp(); k = inp(); a = inp(); b = inp(); for(int i = 1; i <= k; i++) pos[i] = inp(); std::sort(pos + 1, pos + k + 1); printf("%I64d\n", solve(1, 1 << n)); return0; }