word=list(input().split(" "))
num=list(input().split(" "))
num.sort()
time=int(word[1])
n=time*int(num[0])
for i in range(1,len(num)):
    n=n+int(num[i])*(time-1)
print(n)
75f18f7ed5b1e4e89733bdd532cf2c37951e9752
<mask token>

<mask token>
num.sort()
<mask token>
for i in range(1, len(num)):
    n = n + int(num[i]) * (time - 1)
print(n)

word = list(input().split(' '))
num = list(input().split(' '))
num.sort()
time = int(word[1])
n = time * int(num[0])
for i in range(1, len(num)):
    n = n + int(num[i]) * (time - 1)
print(n)

word=list(input().split(" "))
num=list(input().split(" "))
num.sort()
time=int(word[1])
n=time*int(num[0])
for i in range(1,len(num)):
    n=n+int(num[i])*(time-1)
print(n)