Bloodseeker is facing $$$n$$$ enemies. In the beginning, he has $$$m$$$ hit-points, and every second his hit-points are decreased by $$$1$$$ (this decrease is continuous and uniform). If his hit-points become $$$0$$$, he dies. But he can kill the enemies to regenerate his hit-points.
The $$$i$$$-th enemy is to be hit $$$t_i$$$ times to kill. Bloodseeker makes one hit per second. Every second, he is able to hit any enemy. After the $$$i$$$-th enemy receives a last hit, Bloodseeker regenerates $$$h_i$$$ hit-points (but his hit-points can't become greater than $$$m$$$). Note that if Bloodseeker had $$$1$$$ hit-point before he last-hits the $$$i$$$-th enemy, he doesn't die (his hit-points are decreased to $$$0$$$, but at this moment regeneration is applied instantly).
Can Bloodseeker kill all enemies?
The first line contains an integer $$$T$$$ ($$$1 \le T \le 200000$$$) — the number of test cases.
The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 200000, 1 \le m \le 10^9$$$) — the number of enemies and the maximal Bloodseeker's hit-points.
Each of the next $$$n$$$ lines in each test case contains two integers $$$t_i$$$ and $$$h_i$$$ ($$$1 \le t_i, h_i \le 10^9$$$) — the time required for killing the $$$i$$$-th enemy and the number of hit-points regenerated after it.
It is guaranteed that the sum of all $$$n$$$ does not exceed $$$200000$$$.
For each test case, if it's possible to kill all the enemies, output "YES", otherwise output "NO".
4 2 10 7 3 6 1 2 10 7 3 7 1 3 10 5 7 5 7 14 1 3 10 5 7 5 7 15 1
YES NO YES NO
Название |
---|