N, M, K = map(int, input().split()) A = list(map(int, input().split())) if N > 0 else [] max_A = max(A) if A else 0 max_candidate = 0 for t in range(0, K + 1): if t == 0: current_sum = 0 else: base = (t - 1) * max_A if base > M: continue remaining = M - base max_x = -1 for a in A: if a <= remaining and a > max_x: max_x = a if max_x == -1: continue current_sum = base + max_x if current_sum <= M and current_sum > max_candidate: max_candidate = current_sum print(max_candidate)