Mr. Geek is a greedy seller. He has a stock of N laptops which comprises of both useful and useless laptops. Now, he wants to organize a sale to clear his stock of useless laptops. The prices of N laptops are Ai each consisting of positive and negative integers (-ve denoting useless laptops). In a day, he can sell atmost M laptops. Mr. Geek being a greedy seller want to earn maximum profit out of this sale. So, help him maximizing his profit by selling useless laptops.
The first line of input contains number of testcases T. For each testcase, there will be two lines of input. Th first line contains two integers N and M. The second line contains prices of N laptops.
The maximum profit Mr. Geek can earn in a single day.
1 <= T <= 100
1 <= N ≤ 107
1 <= M <= 107
-1018 <= Ai <= 1018
-6 0 35 4
Geek sells the laptops with price -6 and earns Rs. 6 as profit.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.