#P14478. 手心
手心
Description
Little E has AIs. They no longer want to solve the maximum independent set problem, so they often gather to play Genshin Impact.
Little E noticed that recently fewer AIs are playing Genshin Impact. After investigation, it was found that there are pairs of AIs in conflict. Specifically, for a conflicting pair , and will not play Genshin Impact simultaneously.
It is guaranteed that no duplicate conflicts are counted, and no AI conflicts with itself. Conflicts are unordered.
Little E does not know exactly which AIs are in conflict. But Little E wants to know, in the best and worst cases, what is the maximum number of AIs that can play Genshin Impact simultaneously.
Formal Description
Find the maximum and minimum possible sizes of the maximum independent set over all undirected simple graphs with vertices and edges.
Input Format
This problem has multiple test cases.
For each test point, the first line contains a positive integer , indicating the number of test cases.
Then, lines follow, each containing two integers for one test case.
Output Format
For each test case, output one line. Output two answers separated by a space, indicating the maximum number of AIs playing Genshin Impact simultaneously in the best and worst cases.
2
8 4
4 4
7 4
2 2
Hint
Sample Explanation
For the first test case:
- For the first question, we can construct the graph with edges . Then AIs to can play, so the answer is .
- For the second question, we can construct the graph with edges . Then AIs can play, so the answer is .
For the second test case:
- For the first question, we can construct the graph with edges . Then AIs can play, so the answer is .
- The second question has the same construction, so the answer is .
Data Range
There are test points in this problem, each with equal score.
| Data ID | Special Constraints | ||
|---|---|---|---|
| None | |||
| None |
For all data, , , .
京公网安备 11011102002149号