Devu is a dumb guy, his learning curve is very slow. You are supposed to teach him n subjects, the i^{th} subject has c_{i} chapters. When you teach him, you are supposed to teach all the chapters of a subject continuously.

Let us say that his initial per chapter learning power of a subject is x hours. In other words he can learn a chapter of a particular subject in x hours.

Well Devu is not complete dumb, there is a good thing about him too. If you teach him a subject, then time required to teach any chapter of the next subject will require exactly 1 hour less than previously required (see the examples to understand it more clearly). Note that his per chapter learning power can not be less than 1 hour.

You can teach him the n subjects in any possible order. Find out minimum amount of time (in hours) Devu will take to understand all the subjects and you will be free to do some enjoying task rather than teaching a dumb guy.

Please be careful that answer might not fit in 32 bit data type.


-----Input-----

The first line will contain two space separated integers n, x (1 ≤ n, x ≤ 10^5). The next line will contain n space separated integers: c_1, c_2, ..., c_{n} (1 ≤ c_{i} ≤ 10^5).


-----Output-----

Output a single integer representing the answer to the problem.


-----Examples-----
Input
2 3
4 1

Output
11

Input
4 2
5 1 2 1

Output
10

Input
3 3
1 1 1

Output
6



-----Note-----

Look at the first example. Consider the order of subjects: 1, 2. When you teach Devu the first subject, it will take him 3 hours per chapter, so it will take 12 hours to teach first subject. After teaching first subject, his per chapter learning time will be 2 hours. Now teaching him second subject will take 2 × 1 = 2 hours. Hence you will need to spend 12 + 2 = 14 hours.

Consider the order of subjects: 2, 1. When you teach Devu the second subject, then it will take him 3 hours per chapter, so it will take 3 × 1 = 3 hours to teach the second subject. After teaching the second subject, his per chapter learning time will be 2 hours. Now teaching him the first subject will take 2 × 4 = 8 hours. Hence you will need to spend 11 hours.

So overall, minimum of both the cases is 11 hours.

Look at the third example. The order in this example doesn't matter. When you teach Devu the first subject, it will take him 3 hours per chapter. When you teach Devu the second subject, it will take him 2 hours per chapter. When you teach Devu the third subject, it will take him 1 hours per chapter. In total it takes 6 hours.

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Round 251 Div 2 Problem B

Author  : chaotic_iak
Language: Python 3.3.4
"""

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0:
        return inputs
    if mode == 1:
        return inputs.split()
    if mode == 2:
        return [int(x) for x in inputs.split()]

def write(s="\n"):
    if isinstance(s, list): s = " ".join(s)
    s = str(s)
    print(s, end="")

################################################### SOLUTION
n,x = read()
c = read()
c.sort()
print(sum(max(x-i,1)*c[i] for i in range(n)))

n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in a:
    s+=x*i
    x = max(x-1,1)
print(s)

buf = input().split(" ")
n = int(buf[0])
k = int(buf[1])

buf = input().split(" ")
for i in range(n):
    buf[i] = int(buf[i])
buf = sorted(buf)

wyn = 0
for i in range(n):
    wyn += buf[i]*k
    k = max(1, k-1)
    
print(wyn)

n, x = list(map(int, input().split()))
a = sorted(list(map(int, input().split())))
s = 0
for i in range(n):
    s += a[i] * max(1, x - i)
print(s)


n, x = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
c.sort()


time = 0
for i in c:
    time += i * x
    x = max(1, x - 1)

print(time)


sa=input().split(' ')
subjs=int(sa[0])
#timeper chapter
time=int(sa[1])
sa2=input().split(' ')
sa3=[]
for item in sa2:
    sa3.append(int(item))

sa3.sort()

tot=0
for thing in sa3:
    tot+=thing*time

    if time!=1:
        time-=1


print(tot)


(n,x)=list(map(int, input().split()))
c=list(map(int, input().split()))
c.sort()
time=0
for i in range(n):
    time+=x*c[i]
    if x>1:
        x-=1
print(time)


# -*- coding: utf-8 -*-

n, x = list(map(int, input().split()))

cs = sorted(map(int, input().split()))


summa = 0
for c in cs:
    summa += x*c
    x = (x-1 if x-1 >= 1 else 1)

print(summa)





n, x = list(map(int, input().split()))
c = list(map(int, input().split()))

c.sort()
res = 0
learn_time = x
for i in range(n):
	res += c[i]*learn_time
	if learn_time > 1:
		learn_time -= 1
print(res)


(n, x) = list(map(int, input().split()))
c = list(map(int, input().split()))
c.sort()
time = 0
for ci in c:
    time += x * ci
    x = max(x - 1, 1)
print(time)


n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
l.sort()
t = 0
for i in l:
	t += i * x
	x = max(1,x-1)
print(t)

n, x = [int(c) for c in input().split()]
disc = [int(c) for c in input().split()]

disc.sort()

res = 0

for i in range(len(disc)):
    res += disc[i] * x
    if x > 1:
        x -= 1

print(res)

_, x = list(map(int, input().split()))
c = sorted(list(map(int, input().split())))
r = 0
for i in c:
    r += i*x
    x = max(1, x-1)
print(r)



n, x = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [0]*100001
for ci in c:
    d[ci] += 1
time = 0
ci = 1
while ci < 100001:
    if d[ci] > 0:
        time += x * ci
        d[ci] -= 1
        x = max(1,x-1)
    else:
        ci += 1
print(time)


n, x = list(map(int, input().split(' ')))
cs = list(map(int, input().split(' ')))

x_work = list(range(x,0,-1))+[1]*n
cs.sort()


answer = 0
for i,item in enumerate(cs):
    answer += x_work[i]*item

print(answer)


a=list(map(int,input().split()))
n=a[0]
x=a[1]

gg=list(map(int,input().split()))
gg.sort()
h=0
for i in range(n):
	h+=gg[i]*x
	if x>1: x-=1
print(h)


n,x=list(map(int,input().split()))
dis=list(map(int,input().split()))
dis.sort()
time=0
for c in dis:
    time+=c*x
    if(x!=1):
        x-=1
print(time)


n, x = list(map(int, input().split()))
c = list(map(int,input().split()))

t = 0
c.sort()

for i in range(n):
    t += x*c[i]
    x -= 1
    if x <= 0:
        x = 1
print(t)


from sys import stdin as cin,stdout as cout
from math import factorial as f
from itertools import combinations as comb
n,x = list(map(int,(cin.readline().split())))
a = list(map(int,(cin.readline().split())))
a.sort()
t = 0
for i in range(n):
    m = x-i
    if m<1:
        m = 1
    t+=m*a[i]
print(t)





nx = input().split()
for i in range(len(nx)):
    nx[i] = int(nx[i])
n = nx[0]
x = nx[1]

mas = input().split()
for i in range(len(mas)):
    mas[i] = int(mas[i])
mas.sort()

sum = 0
for i in mas:
    sum = sum + i*x
    if(x>1):
        x = x - 1
print(sum)

(n, m), a, t, h = list(map(int, input().split())), list(map(int, input().split())), 0, 0

a.sort()

for i in range(n):
    if (m - i) <= 0:
        t = t + a[i] * 1
    else:
        t = t + a[i] * (m - i)

print( t )

import sys

# f = open("b.txt", "r+")
f = sys.stdin

n, x = map(int, f.readline().strip().split())
c = list(map(int, f.readline().strip().split()))

c.sort()

time = 0

for i in c:
    time += i*x
    x -= 1 if x > 1 else 0

print(time)


[n,x] = [int(i) for i in input().split()]
c = sorted([int(i) for i in input().split()])
time = 0
k = 0
while k<len(c):
	time+=x*c[k]
	if x>1:
		x-=1
	k +=1
print(time)



n,x=map(int,input().split())
l=list(map(int,input().split()))
time=0
l.sort()
for i in range(n):
    if(x==1):
        time=time+(x*sum(l[i:n]))
        break
    else:
        temp=l[i]
        time=time+(x*temp)
        x=x-1
print(time)

n, x = map(int, input().split())

c = sorted(list(map(int, input().split())))
ret = 0
for y in c:
	ret += x * y
	x = max(x - 1, 1)

print(ret)