#T651. 系统最佳安排
系统最佳安排
Description
CodesOnline's OJ system 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 at most one competition is scheduled at any given time. Now Xiao Tu has a timetable of several planned competitions and wants to arrange as many as possible. How should he schedule them?
Input Format
The first line is an integer m (m < 100) representing the number of test cases.
The first line of each test case is an integer n (1 < n < 10000) indicating the number of competitions in that test case.
The subsequent n lines each contain two positive integers Bi and Ei (0 <= Bi, Ei < 10000), representing 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