Time Limit: 1 second(s) | Memory Limit: 32 MB |
Given n coins, values of them are A_{1}, A_{2} ... A_{n} 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 (≤ 100), denoting the number of test cases.
Each case starts with a line containing two integers n (1 ≤ n ≤ 18) and K (1 ≤ K ≤ 10^{9}). The next line contains n distinct integers denoting the values of the coins. These values will lie in the range [1, 10^{7}].
For each case, print the case number and 'Yes' if you can pay K using the coins, or 'No' if it's not possible.
Sample Input |
Output for Sample Input |
3 2 5 1 2 2 10 1 2 3 10 1 3 5 |
Case 1: Yes Case 2: No Case 3: Yes |
Developed and Maintained by
JANE ALAM JAN |
Copyright © 2012
LightOJ, Jane Alam Jan |