![]() |
#2
诸葛修勤2011-05-12 23:41
|
Recently, a shopping mall is making sale promotional activity. If you buy goods worth m yuan or more, they will return you r yuan cash. bailey is so poor that he wants to get r yuan with minimum cost. Please help him.
Input
The first line is an integer c which shows the number of cases. Each case contains 2 lines. The first line has 2 positive integers n and m, n is the number of goods. The second line contains n positive integers which are the price of each goods. You must remember that bailey hates to buy two same goods.(0<n<100, 0<m<1000)
Output
For each case print the minimum cost in a single line.
Sample Input
2 2 100 50 70 3 100 50 50 70
Sample Output
120 100