#692
Unrated
Job Completion
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Bessie the cow has NN (1N21051\le N\le 2\cdot 10^5) jobs for you to potentially complete. The ii-th one, if you choose to complete it, must be started at or before time sis_i and takes tit_i time to complete (0si1018,1ti10180\le s_i\le 10^{18}, 1\le t_i\le 10^{18}).

What is the maximum number of jobs you can complete? Time starts at 00, and once you start a job you must work on it until it is complete, without starting any other jobs in the meantime.

입력

The first line contains TT, the number of independent test cases (1T101\le T\le 10). Each test case is formatted as follows.

The first line contains NN.

Each of the next NN lines contains two integers sis_i and tit_i. Row i+1i+1 has the details for the iith job.

It is guaranteed that the sum of NN over all test cases does not exceed 31053\cdot 10^5.

출력

For each test case, the maximum number of jobs you can complete, on a new line.

예제 입력 1

3
2
1 4
1 2
2
2 3
1 2
3
1 4
2 3
1 2

예제 출력 1

1
2
2

점수

Inputs 2: Within the same test case, all tit_i are equal.Inputs 3-4: N2000N\le 2000, si,ti2000s_i, t_i\le 2000Inputs 5-8: N2000N\le 2000Inputs 9-16: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.