#K2286. Minimum Initial Strength

    ID: 24703 Type: Default 1000ms 256MiB

Minimum Initial Strength

Minimum Initial Strength

You are given several test cases. In each test case you have n warriors. Each warrior is represented by two integers: its strength \(s_i\) and its threshold \(t_i\). In order to defeat a warrior, your current strength must be at least \(s_i\). Although the threshold value \(t_i\) is provided, the minimum initial strength needed to defeat all warriors in a test case turns out to be \(\max \{s_i\}\) for that test case.

Your task is to compute the minimum initial strength required for each test case.

Example:
For a test case with warriors: (10, 5), (6, 3), (8, 1), the answer is 10 since \(\max(10,6,8)=10\). Likewise, for warriors: (12, 5), (7, 2), the answer is 12.

inputFormat

The first line of the input contains an integer \(T\) representing the number of test cases. For each test case, the first line contains an integer \(n\), the number of warriors. The next \(n\) lines each contain two space-separated integers \(s_i\) and \(t_i\), representing the strength and threshold of the \(i\)-th warrior.

The input is given via standard input (stdin).

outputFormat

For each test case, output a single line containing the minimum initial strength required. The result for each test case should be printed on a separate line via standard output (stdout).

## sample
2
3
10 5
6 3
8 1
2
12 5
7 2
10

12

</p>