N, M, K = map(int, input().split())
Array = list(map(int, input().split()))
Array.sort()
first = Array[N-1]
secound = Array[N-2]
count = 0 # 큰 수의 법칙에 따른 결과
while True:
for _ in range(K):
count += first
if M == 0:
break
M -= 1
if M == 0:
break
count += secound
M -= 1
print(count)