问题
Bessie the cow has
What is the maximum number of jobs you can complete? Time starts at
输入
The first line contains
The first line contains
Each of the next
It is guaranteed that the sum of
输出
For each test case, the maximum number of jobs you can complete, on a new line.
子任务
| 编号 | 分数 | 条件 |
|---|---|---|
| #1 | 10分 | Within the same test case, all |
| #2 | 20分 | |
| #3 | 30分 | |
| #4 | 40分 | No additional constraints. |
示例
3
2
1 4
1 2
2
2 3
1 2
3
1 4
2 3
1 2
1
2
2
For the first test case, you can only complete one of the jobs. After completing one job, it will then be time
For the second test case, you can start the second job at time