1002. Valuable Jewellery
| ||||||
| ||||||
Description
The difficult economic situation in the country and reductions in government agricultural subsidy funding have caused Mirko to change his career again, this time to a thief. His first professional endeavour is a jewellery store heist.
Input
The first line of input contains two numbers, N and K (1 ≤ N, K ≤ 300 000).
Output
The first and only line of output must contain the maximum possible total jewellery value.
Sample Input
样例1: 2 1 5 10 100 100 11 样例2: 3 2 1 65 5 23 2 99 10 2
Sample Output
样例1: 10 样例2: 164
Hint
Clarification of the second example: Mirko stores the first piece of jewellery into the second bag and the third piece into the first bag. |