You have n cards with natural numbers. Card i shows ai at the start. One merge follows these steps.
Choose two different cards, card x and card y, and compute the sum of the two numbers. (x=y)
Write the computed value on both card x and card y.
After m merges, the score is the sum of the numbers on all n cards. Choose the cards to merge so the score is as small as possible, and compute the smallest possible score.
Input
The first line contains the number of cards n (2≤n≤1000) and the number of merges m (0≤m≤15n), separated by a space.
The second line contains the n initial natural numbers a1,a2,…,an, separated by spaces. (1≤ai≤1000000)
Output
Print the smallest possible score on the first line.