Prof. Pang has a multi-set of intervals $$$S=\{[l_i,r_i]\}$$$($$$l_i \lt r_i$$$).
Prof. Pang will perform the following operation for $$$|S|-1$$$ times:
It's easy to find that $$$S$$$ contains exactly one interval after the operations, and Prof. Pang will get the interval as a gift.
Now Prof. Pang wants you to calculate how many different intervals he can get.
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 \lt r_i\le 10^9$$$), describing the $$$i$$$-th interval in $$$S$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases is no more than $$$10^5$$$.
For each test case, output one line containing the answer to Prof. Pang's question.
411 100000000021 10000000001 100000000041 23 45 67 841 32 45 86 7
1 499999999500000000 26 28
| Name |
|---|


