問題
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