3011. Coins (IV)

单点时限: 1.0 sec

内存限制: 256 MB

Given n coins, values of them are A1,A2,,An respectively, you have to find whether you can pay K using the coins. You can use any coin at most two times.

输入格式

Input starts with an integer T (T20), denoting the number of test cases.

Each case starts with a line containing two integers n (1n18) and K (1K109). The next line contains n distinct integers denoting the values of the coins. These values will lie in the range [1,107].

输出格式

For each case, print the case number and Yes if you can pay K using the coins, or No if it’s not possible.

样例

Input
3
2 5
1 2
2 10
1 2
3 10
1 3 5
Output
Case 1: Yes
Case 2: No
Case 3: Yes

11 人解决,20 人已尝试。

13 份提交通过,共有 63 份提交。

6.6 EMB 奖励。

创建: 11 年,7 月前.

修改: 7 年,5 月前.

最后提交: 3 天,19 小时前.

来源: Coins 系列

题目标签