大虾高手都来看看帮一下忙!求解一道HOJ题目。。。
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