문제1468--By lot

1468: By lot

실행시간 제한: 3 Sec  메모리사용 제한: 128 MB
제출: 34  통과: 19
[제출] [채점기록] [묻고답하기] [만든사람:]

문제 설명

There are n pieces of paper with numbers written on them (the written numbers are k1, k2, …, kn). If you select a paper 4 times by restoration extraction from the box and the sum of the values is m, you win. 
If you know all the n numbers in the box, check if there is a case where the sum is m, and if so, print Yes, and if not, print No.

입력 설명

The number of papers(n) and the number of m values(t) to be found are given on the first line. (1 <= n <= 200, 1<= t <= 100)
Then, n values of ki are entered on the next line, and from the next line, t values of m to be found are given. (1 <= m <= 104, 1<= ki <= 104)

출력 설명

For each test case(t), if you can create an m value with 4 cards, print Yes or No, one per line.

입력 예시 Copy

50 4
4268 6316 8953 984 5664 2060 7994 2434 4006 8693 4881 9186 8520 7967 8545 4402 5983 7991 7834 179 6246 6920 8605 1677 1003 9890 9413 8487 1988 5381 899 369 4544 9651 7507 2492 7144 2229 4944 2585 5083 609 9906 9118 464 3530 6579 233 1913 2551
20000
999
34563
3596

출력 예시 Copy

Yes
No
Yes
Yes

출처/분류