P20996 [HackerEarth] 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 the
普及
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
20 861 761 436 20 53 70 126 176 143 95 758 312 907 409 183 29 887 63 355 781 941 21 235 192 358 43 20 93 106 138 551 196 10 576 195 875 263 213 449 401 639 73 934 655 222 98 53 71 141 537 976 662 669 26 11 294 729 93 436 17 15 246 341 467 552 962 915 20 213 199 214 461 68 134 63 907 730 65 595 102 24 466 531 526 10 610 57 10 181 678 30 12 511 536 368 296 18 772 254 10 495 784 40 65 12 63 668 723 11 306 255 706 292 202 104 51 141 46 500 478 159 683 44 319 28 271 192 163 828 683 564 20 526 612 937 85 194 532 729 56 190 29 46 518 363 18 134 60 741 529 321 353 874 90 376 71 11 391 83 52 179 772 832 292 690 524 434 459 571 38 10 32 415 58 96 352 802 47 848 436 980 73 621 174 60 10 60 339 250 64 39 423 588 838 678 20 314 743 943 659 696 10 10 10 352 223 53 91 733 594 19 384 64 487 15 11 770 569 639 471 590 613 747 777 99 217 12 666 132 396 456 914 186 72 157 505 952 153 143 56 197 380 988 876 869 213 672 76 388 744 68 504 684 833 56 709 861 317 892 20 18 145 886 649 860 629 155 836 119 430 13 420 712 461 982 92 604 10 304 69 68 128 30 814 138 217 726 76 17 255 332 399 820 256 366 30 907 304 186 76 49 439 796 289 273 16 515 355 10 10 223 596 355 758 429 218 10 573 213 10 978 383 580 20 58 445 25 462 16 364 44 639 37 22 876 239 437 128 293 540 588 21 304 22 249 310 957 587 29 589 10 99 983 763 96 49 987 119 10 62 654 53 10 151 435 15 13 300 449 399 656 102 10 158 322 215 688 112 10 116 576 207 283 517 708 39 464 20 691 490 32 10 10 785 130 230 92 83 66 217 30 106 576 10 734 108 70 193 173 501 467 154 873 696 10 259 285 183 205 26 423 10 100 10 544 920 63 357 856 93 503 13 41 372 62 393 438 181 35 877 369 662 636 897 273 23 987 807 905 801 686 20 96 702 733 255 767 766 813 66 80 561 418 216 37 778 95 765 818 433 869 761 45 270 635 304 623 356 44 871 407 13 12 303 607 972 148 951 374 280 16 179 191 583 38 552 19 22 91 66 243 981 10 13 171 864 91 11 129 168 728 757 658 874 116 20 201 149 224 18 834 789 41 90 23 28 615 25 435 144 568 777 41 921 129 375 447 256 804 531 439 63 10 223 324 105 54 204 977 669 10 66 23 99 12 132 600 90 302 77 38 354 406 307 328 182 53 14 203 633 914 978 14 300 15 542 197 605 392 20 291 432 777 994 340 355 166 146 272 831 109 693 226 501 21 884 12 632 90 181 105 18 977 431 46 558 526 142 272 660 439 315 284 13 269 254 92 164 320 207 902 232 137 529 535 126 815 388 74 450 917 584 405 150 10 224 589 530 282 795 382 993 459 20 917 103 568 776 500 372 18 900 13 92 367 16 803 755 414 94 321 521 746 421 216 313 321 18 628 147 561 451 65 898 747 179 336 249 37 590 397 166 431 248 550 433 42 76 10 94 56 10 353 963 11 307 821 100 29 994 478 588 35 454 100 100 100 1 100 100 100 737 308 815 20 11 117 72 13 23 13 220 939 229 215 852 88 20 563 36 544 713 524 98 626 333 15 401 270 35 232 110 546 458 955 25 351 194 27 239 494 675 206 38 40 107 844 16 69 753 431 504 123 33 10 11 938 82 14 151 186 974 230 174 22 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 393 821 883 20 389 586 269 363 927 476 156 65 852 92 924 146 40 332 572 205 135 101 69 62 351 156 849 10 35 18 438 355 39 774 478 477 442 59 744 795 188 213 136 11 712 410 703 728 365 91 960 333 36 157 517 880 71 23 253 46 520 924 39 79 812 491 534 20 663 690 103 165 644 334 49 26 10 267 184 231 242 323 171 31 273 777 549 35 588 824 28 53 553 68 206 772 97 64 21 698 558 31 10 849 10 261 792 836 756 11 403 860 794 670 234 13 196 646 532 841 396 370 994 67 441 108 84 243 291 999 572 20 514 631 123 688 547 135 822 542 52 95 22 100 25 100 384 28 174 413 37 474 15 702 511 465 10 26 742 616 863 74 815 850 707 364 10 563 48 43 225 725 75 62 991 270 100 26 131 867 168 803 59 289 408 23 70 54 234 459 876 640 826 133 225 20 109 598 886 630 811 280 463 241 444 101 746 10 14 847 927 45 742 961 10 720 111 800 773 320 391 13 234 594 21 99 232 112 126 304 965 351 907 46 310 189 40 168 39 80 443 234 29 846 647 40 56 307 66 548 407 93 878 848 15 186 181 750 819 20 60 10 576 303 39 917 158 159 42 16 499 333 115 959 782 841 229 358 142 10 742 181 750 819 53 588 951 668 160 18 10 66 238 865 416 10 374 107 988 149 926 470 59 223 914 11 564 201 23 24 28 10 359 455 818 159 841 132 963 10 740 805 935 20 671 884 37 365 527 774 619 185 48 333 125 542 355 739 513 299 249 12 238 247 668 10 365 122 15 744 212 992 709 806 20 368 520 889 217 399 528 547 355 314 24 215 130 363 807 441 556 923 477 124 172 528 95 447 389 129 289 36 12 620
样例输出
Case #1: no Case #2: yes Case #3: yes Case #4: no Case #5: no Case #6: yes Case #7: yes Case #8: no Case #9: no Case #10: no Case #11: yes Case #12: yes Case #13: yes Case #14: yes Case #15: yes Case #16: yes Case #17: no Case #18: yes Case #19: no Case #20: yes