#t359. 运输
运输
Transportation
Problem Description
Now we know there are items, and the cost to move each one individually. The moving company's boss, Mr. S, decides that each time we may arbitrarily pick items. Then these items are charged as only one item. But the moving cost for these items is the result of dividing the sum of the two items' costs by . Repeat this until only one item's worth of money is charged. This is the fee the store has to pay. The shopkeeper wants to pay as little as possible, so as to donate more money to the Hope Project. Please help him compute the minimum amount he has to pay.
Input Format
The first line contains two integers .
The second line contains integers , the moving cost of each item.
Output Format
One line with a single integer, the minimum amount to pay.
Sample Input
5 2
1 2 3 4 5
Sample Output
1
Hint
are all non-negative numbers. .
: A new Hack test case was added. Whether a correct solution exists for this data range is disputed.