from collections import * def div(n): i = 1 SS = set() while i * i <= n: if n % i == 0: SS.add(i) SS.add(n//i) i += 1 return sorted(list(SS)) N, M, A, B = map(int, input().split()) C = sorted(list(map(int, input().split()))) inf = 10 ** 18 dic = defaultdict(lambda : inf) minv = defaultdict(lambda : inf) dic[1] = 0 D = div(N) K = len(D) for i in range(K): for j in range(M): if C[j] % D[i] == 0: minv[D[i]] = min(minv[D[i]], C[j]) for i in range(1, K): val = inf for j in range(i): if D[i] % D[j] == 0 and minv[D[j]] > D[i]: val = min(val, dic[D[j]] + B * int(i