The Lalalandia's Christmas is coming! Only N days are left and Jambo wants to buy all his friends a present. There are N presents that his friends want and Jambo, because he is a very small elephant, cannot buy and carry more than K presents at any day. Every present in jth day costs ai∗j for every 1≤j≤N. Can you help Jambo determine the minimum amount of money needed to buy all presents and make his friends happy?
Input format
The first line consists of integers N - the number of days and the number of presents Jambo wants to buy, and K - the number of presents Jambo can carry. The second line contains n integers a1, a2, ..., aN — the cost of the ith present.
Output format
The first line should contain the single integer - answer to the problem.
Constraints:
1≤N≤105
1≤K≤N
1 ≤ ai ≤ 109
Since K equals to 1, the optimal solution is 3∗1+2∗2+1∗3=10.