The input contains several test cases, and the first line contains a single integer $T~(1 \le T \le 90)$, the number of test cases.
For each test case, the first line contains an integer $n~(1 \le n \le 100\,000)$, indicating the number of coin groups.
Each of the following $n$ lines contains two integers $a_i,b_i~(1 \le a_i, b_i \le 10\,000)$ indicating the coin values in that group.
It is guaranteed that the sum of $n$ in all test cases does not exceed $2\,100\,000$.