#C11537. Maximum Unique Resources
Maximum Unique Resources
Maximum Unique Resources
You are given several test cases. Each test case contains a list of resource usage constraints, where each constraint is represented by two integers: the minimum and maximum allowed usage of that resource. In each test case, the maximum number of distinct resources that can be used is simply the total number of resource constraints provided.
Your task is to compute this value for each test case.
Example:
Input: 3 3 3 5 1 2 2 4 1 1 1000000000 4 2 3 1 1 2 4 1 2</p>Output: 3 1 4
Explanation: In the first test case there are 3 constraints, in the second test case there is 1 constraint, and in the third test case there are 4 constraints. Therefore, the outputs are 3, 1, and 4 respectively.
inputFormat
The input is read from standard input (stdin) with the following format:
- The first line contains an integer T, the number of test cases.
- For each test case:
- The first line contains an integer n, the number of resource constraints.
- The next n lines each contain two integers. The first integer is the minimum usage and the second is the maximum usage for that resource.
outputFormat
For each test case, output the maximum number of distinct resources (which is the number of resource constraints) on a separate line to standard output (stdout).
## sample3
3
3 5
1 2
2 4
1
1 1000000000
4
2 3
1 1
2 4
1 2
3
1
4
</p>