题目描述
While some participants are busy with their events, some are busy checking out the various Food Stalls. Now, it so happens that some of the participants are very health conscious but they also want to check out the various food stalls. So, they decide to eat only a specific amount of proteins, vitamins, and cholesterol. Different food items contain different amounts of proteins, vitamins, and cholesterol. A person can either choose to eat an item or not eat it, he/she can't eat a fraction of it. Also, he can't eat a certain food item more than once.
Input:
Input begins with an integer T, the number of test cases. For each test case, the first line consists of three space-separated integers: GP,GV, and GC, which represent the amount of proteins, vitamins, and cholesterol that Alex wants to eat. The next line has the number of foods for that test case, an integer N. The next N lines each consist of three space-separated integers: P, C, and F, which represent the amount of proteins, vitamins, and cholesterol in that food, respectively.
Output:
For each test case i, print a line containing "Case #i: " followed by either "yes" if it is possible for Alex to eat the exact amount of each macronutrient, or "no" if it is not possible.
Constraints:
1 ≤ T ≤ 20
1 ≤ N ≤ 20
10 ≤ GP, GV, GC ≤ 1000
10 ≤ P, V, C ≤ 1000
SAMPLE INPUT
5
100 100 100
1
100 100 100
100 100 100
3
10 10 40
10 30 10
10 60 50
100 100 100
5
40 70 30
30 10 40
20 20 50
10 50 90
40 10 20
292 264 512
20
909 302 261
705 597 823
291 51 126
28 697 57
593 31 826
311 256 57
292 14 47
29 730 716
12 529 146
768 16 439
37 472 15
350 192 34
163 468 238
69 173 10
203 72 690
424 875 213
223 593 292
151 46 10
88 90 16
773 653 711
991 827 352
20
29 560 929
139 681 102
144 853 10
84 729 80
218 20 67
140 80 901
428 20 500
520 970 128
422 419 30
413 101 192
467 448 501
32 939 684
34 20 38
251 317 132
588 437 10
648 21 79
391 25 14
499 22 24
854 77 361
405 25 20
SAMPLE OUTPUT
Case #1: yes
Case #2: no
Case #3: yes
Case #4: no
Case #5: yes
输入格式
见题面
输出格式
见题面