HC sends you a link to an urgent file. The file is too large to download it singly, so you decide to download it in chunks.
Assume that the file is divided into $$$n$$$ chunks. For the $$$i$$$-th chunk, it will be successfully connected at moment $$$p_i$$$, then it will take exactly $$$t_i$$$ seconds to download.
Determine the moment $$$P$$$ when all chunks are successfully connected and the moment $$$F$$$ when all chunks finish downloading.
The first line contains a single integer $$$t$$$ $$$(1 \leq t \leq 10 ^ 4)$$$, denoting the number of test cases.
The first line of each test case contains a single integer $$$n$$$ $$$(1 \leq n \leq 2 \times 10 ^ 5)$$$.
The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$p_i$$$, $$$t_i$$$ $$$(1 \leq p_i, t_i \leq 10^9)$$$.
It's guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \times 10 ^ 5$$$.
For each test case, output two integers $$$P$$$, $$$F$$$, denoting the moment when all chunks are successfully connected and the moment when all chunks finish downloading.
211 132 31 13 2
1 2 3 5
In the first test case, there is only $$$1$$$ chunk. Evidently, $$$P=1$$$, $$$F=2$$$.
In the second test case, there are $$$3$$$ chunks.
Therefore, $$$P=3$$$, $$$F=5$$$.
| Name |
|---|


