The first line of the input contains a single integer $T$ ($1 \leq T \leq 10\,000$), the number of test cases.
For each case, the first line of the input contains an integer $n$ ($1 \leq n \leq 300\,000$), denoting the number of dishes of meat.
Each of the following $n$ lines contains two integers $a_i$ and $b_i$ ($1\leq a_i,b_i\leq
10^9$), denoting each dish of meat.
It is guaranteed that the sum of all $n$ is at most $1\,000\,000$.