P13873 [CodeChef] coop5
NOI
题目描述

Bala's room is in a mess. He's been so busy doing research that he hasn't bothered to clean out his room for months. Now he has decided to sort out all the items in his room and keep only the essential ones. He knows the usefulness of each of the 'N' items that he has, and wants to keep only the 'K' most useful items. Bala is also very forgetful, so he wants a procedure that doesn't require him to remember too many things at once.

Input
The first line of input contains 'T', the number of test cases (1 ≤ T ≤ 100). This is followed by T test cases. Each test case begins with a blank line followed by one line containing two numbers 'N' (number of items), and 'K' (number of essential items) (1 ≤ K ≤ N ≤ 100000000). This is followed by one line containing the usefulness of all the 'N' items, seperated by spaces.

Output
The output should consist of 'T' lines corresponding to the 'T' test cases. Each line should contain one number, which is the sum of the usefulness of the 'K' most useful items.

Example

Input:
2

5 2
10 23 47 3 17

10 4
87 45 99 27 58 100 38 50 31 62

Output:
70
348

输入格式

见题面

输出格式

见题面

样例输入
2 5 2 10 23 47 3 17 10 4 87 45 99 27 58 100 38 50 31 62
样例输出
70 348