Dividing the Loot#3118

Dividing the Loot

1 second
64 megabytes
Very easy

You have successfully led a group of pirates in taking over a commercial vessel. You have seized gold coins, silver coins, and other precious goods. Now it comes down to dividing the loot. It is important to keep everyone satisfied, otherwise you risk mutiny. A pirate is not satisfied if another pirate gets more items than he does. Therefore, you might have to content yourself with fewer items than the other pirates or throw some items into the open sea. Fortunately, the other pirates have no notion of the value of the items, while you do. Can you make the most out of this without mutiny?

Input

The first line contains the number of test cases.

The first line of each test case contains two integers and (0 \leq p \leq 1000, 1 \leq n \leq 1000) — the number of pirates you have to share the loot with, and the number of items.

The second line of each test case contains integers v_i (1 \leq v_i \leq 1000) — the value of each item.

Output

For each test case, output a single integer — the largest possible total value of items you can keep for yourself, while keeping all the other pirates satisfied.

Examples

Example 1

Loading
Loading