아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Bloodseeker

시간 제한2초메모리 제한512 MB

요약
각 적의 처치 시간과 회복량이 주어질 때, 체력이 0이 되기 전에 모든 적을 처치할 수 있는지 판정한다.
난이도

보통10점 중 7점

유형
그리디, 정렬, 수학, 구현
정답자
아직 제출이 없습니다

문제

Bloodseeker is facing nn enemies. At the beginning, he has mm hit-points, and every second his hit-points are decreased by 11. If his hit-points become 00, he dies. But he can kill the enemies to regenerate his hit-points.

The ii-th enemy is to be hit t_it\_i times to kill. Bloodseeker makes one hit per second. Every second, he is able to hit any enemy. After the ii-th enemy receives a last hit, Bloodseeker regenerates h_ih\_i hit-points (but his hit-points can't become greater than mm). Note that if Bloodseeker had 11 hit-point before he last-hits the ii-th enemy, he doesn't die.

Can Bloodseeker kill all enemies?

입력

The first line contains an integer TT (1≤T≤2000001 \le T \le 200000) --- the number of test cases.

The first line of each test case contains two integers nn and mm (1≤n≤200000,1≤m≤1091 \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 nn lines in each test case contains two integers t_it\_i and h_ih\_i (1≤t_i,h_i≤1091 \le t\_i, h\_i \le 10^9) --- the time required for killing the ii-th enemy and the number of hit-points regenerated after it.

It is guaranteed that the sum of all nn does not exceed 200000200000.

출력

For each test case, if it's possible to kill all the enemies, output "YES", otherwise output "NO".

예제1

  1. 예제 1

    입력
    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