| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 853 人关注过本帖
标题:大虾高手都来看看帮一下忙!求解一道HOJ题目。。。
取消只看楼主 加入收藏
fightingsss
Rank: 6Rank: 6
等 级:侠之大者
帖 子:97
专家分:471
注 册:2010-11-12
结帖率:80%
收藏
已结贴  问题点数:20 回复次数:0 
大虾高手都来看看帮一下忙!求解一道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
搜索更多相关主题的帖子: Recently return 
2011-05-12 19:49
快速回复:大虾高手都来看看帮一下忙!求解一道HOJ题目。。。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020854 second(s), 10 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved