3011. Coins (IV)

单点时限: 1.0 sec

内存限制: 256 MB

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


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

Each case starts with a line containing two integers () and (). The next line contains distinct integers denoting the values of the coins. These values will lie in the range .


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


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

8 人解决,16 人已尝试。

10 份提交通过,共有 53 份提交。

7.3 EMB 奖励。

创建: 6 年,5 月前.

修改: 2 年,3 月前.

最后提交: 1 年,4 月前.

来源: Coins 系列