| Theforces Round #34 (ABC-Forces) |
|---|
| Закончено |
You are given $$$n$$$ tuples $$$(a_i,b_i)$$$. In the beginning, your score is $$$0$$$.
You can do the following operation any number of times in any order:
The first line contains a single integer $$$t$$$ ($$$1 \le t\le 10^4$$$), the number of test cases.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n\le 2 \cdot 10^5$$$).
The next $$$n$$$ lines of each test case contain two integers $$$a_i,b_i$$$ ($$$1\le a_i,b_i\le 10^9$$$).
It is guaranteed that the sum of $$$n$$$ for all tests does not exceed $$$2 \cdot 10^5$$$, and the answer for each test case won't exceed $$$9.2 \cdot 10^{18}$$$.
For each test case, output the maximum score you can get.
321 11000000000 100000000031 32 63 9685 6535 592 65789 2112 329 8
4000000004000000002 446 1220694
In the first case, we can do the following operations:
It can be proven that $$$4000000004000000002$$$ is the maximum of your score.
You can also do the following operations to get the maximum of your score:
| Название |
|---|


