Pro.ID21613 TitleDownload Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21613 AC0 Submit0 Ratio- 时间&空间限制描述Merlin wants to download a lot of files. But the network is so complex that he can't judge whether he can download all of the files in given time. So he wants you, the top coder of ZSU, to help him to judge whether he can download all of the files. At first, Merlin wants to download n files from n different websites. Each website has its download limit. That means in every second, Merlin can download part of the file of band wide size or less. Besides that, the website has its own service time. That is to say, Merlin can begin download the file in the given time, otherwise the website will reject Merlin request. At last, Merlin's computer has its service limit what is that in every second, the computer can download the file using given band wide. Because Merlin's computer is strong (compared of the network service), the time of combining the file can be ignore. So, Can you help him? 输入he input will contain multiply test cases. In each test case, the fist line is three integers n, w and s ( 1 ≤ n ≤ 10, 1 ≤ s ≤ 100 ), n is the number of files to be download, w ( bit/s ) is the band wide of Merlin's computer and s is the limit second that Merlin can download all of the files. And then there are n lines of integers, each line stands for one file. In each line, there are four integers ai, bi, ci and di { 1 ≤ ai, bi ≤ 100000, 1 ≤ ci ≤ di ≤ s ) That means the file can begin to download after the ci second and must download before the di second (download included the ci and di second), the size of file is ai ( bit ) and the band wide of this file website is bi ( bit/s ). The Input will be terminated by n=0. 输出Description Merlin wants to download a lot of files. But the network is so complex that he can't judge whether he can download all of the files in given time. So he wants you, the top coder of ZSU, to help him to judge whether he can download all of the files. At first, Merlin wants to download n files from n different websites. Each website has its download limit. That means in every second, Merlin can download part of the file of band wide size or less. Besides that, the website has its own service time. That is to say, Merlin can begin download the file in the given time, otherwise the website will reject Merlin request. At last, Merlin's computer has its service limit what is that in every second, the computer can download the file using given band wide. Because Merlin's computer is strong (compared of the network service), the time of combining the file can be ignore. So, Can you help him? Input he input will contain multiply test cases. In each test case, the fist line is three integers n, w and s ( 1 ≤ n ≤ 10, 1 ≤ s ≤ 100 ), n is the number of files to be download, w ( bit/s ) is the band wide of Merlin's computer and s is the limit second that Merlin can download all of the files. And then there are n lines of integers, each line stands for one file. In each line, there are four integers ai, bi, ci and di { 1 ≤ ai, bi ≤ 100000, 1 ≤ ci ≤ di ≤ s ) That means the file can begin to download after the ci second and must download before the di second (download included the ci and di second), the size of file is ai ( bit ) and the band wide of this file website is bi ( bit/s ). The Input will be terminated by n=0. Output If Merlin can download all of the files in given second, print one line of "yes", otherwise print one line of "no". Sample Input 3 100 4 Sample Output yes Source 样例输入3 100 4 样例输出yes 作者 |