#T448. 系统最佳安排
系统最佳安排
Description
The OJ system of CodesOnline hosts many C++ competitions every day. Sometimes these competitions may have overlapping schedules, and since competitions cannot be held simultaneously, it's necessary to select a subset of them to host. Xiao Tu works at CodesOJ, and his job is to schedule competitions for the OJ system, ensuring that no more than one competition is scheduled at any given time. Now, Xiao Tu has a timetable of several competition plans and wants to arrange as many competitions as possible. How should he schedule them?
Input Format
The first line is an integer m (m < 100), indicating the number of test cases.
The first line of each test case is an integer n (1 < n < 10000), representing the number of competitions in that test case.
The subsequent n lines each contain two positive integers, Bi and Ei (0 <= Bi, Ei < 10000), indicating the start and end times of the i-th competition, respectively (Bi <= Ei).
Output Format
For each test case, output the maximum number of competitions that can be scheduled.
Each output should occupy a single line.
```input1 2 2 1 10 10 11 3 1 10 10 11 11 20 ``` ```output1 1 2 ``` ## TranslationCodesOJ original adapted problem