P9674 [ICPC 2022 Jinan R] Set of Intervals

Description

Prof. Pang has a multi-set of intervals $S=\{[l_i,r_i]\}$($l_i

Input Format

The first line contains one integer $T~$($1\le T \le 10^4$), the number of test cases. For each test case, the first line contains one integer $n~$($1\le n\le 10^5$) --- the size of $S$. Each of the following $n$ lines contains two integers $l_i$ and $r_i~$($1\le l_i

Output Format

For each test case, output one line containing the answer to Prof. Pang's question.