Bloodseeker
시간 제한2초메모리 제한512 MB
각 적의 처치 시간과 회복량이 주어질 때, 체력이 0이 되기 전에 모든 적을 처치할 수 있는지 판정한다.
문제
Bloodseeker is facing enemies. At the beginning, he has hit-points, and every second his hit-points are decreased by . If his hit-points become , he dies. But he can kill the enemies to regenerate his hit-points.
The -th enemy is to be hit times to kill. Bloodseeker makes one hit per second. Every second, he is able to hit any enemy. After the -th enemy receives a last hit, Bloodseeker regenerates hit-points (but his hit-points can't become greater than ). Note that if Bloodseeker had hit-point before he last-hits the -th enemy, he doesn't die.
Can Bloodseeker kill all enemies?
입력
The first line contains an integer () --- the number of test cases.
The first line of each test case contains two integers and () --- the number of enemies and the maximal Bloodseeker's hit-points.
Each of the next lines in each test case contains two integers and () --- the time required for killing the -th enemy and the number of hit-points regenerated after it.
It is guaranteed that the sum of all does not exceed .
출력
For each test case, if it's possible to kill all the enemies, output "YES", otherwise output "NO".