Problem: Polycarp is designing a level for a game. The level consists of segments on the number line, where the -th segment starts at the point with coordinate and ends at the point with coordinate .
The player starts the level at the point with coordinate . In one move, they can move to any point that is within a distance of no more than . After their -th move, the player must land within the -th segment, that is, at a coordinate such that . This means:
- After the first move, they must be inside the first segment (from to );
- After the second move, they must be inside the second segment (from to );
- ...
- After the -th move, they must be inside the -th segment (from to ).
The level is considered completed if the player reaches the -th segment, following the rules described above. After some thought, Polycarp realized that it is impossible to complete the level with some values of .
Polycarp does not want the level to be too easy, so he asks you to determine the minimum integer with which it is possible to complete the level.
Input Format: The first line contains a single integer ()—the number of test cases. Descriptions of the test cases follow.
The first line of each test case contains a single integer ()—the number of segments in the level.
The following lines.
The -th line contain two integers and ()—the boundaries of the -th segment. Segments may intersect.
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, output a single integer—the minimum value of with which it is possible to complete the level.
Note: In the third example, the player can make the following moves:
- Move from point to point ();
- Move from point to point ();
- Move from point to point ().
Note that for the last move, the player could have chosen not to move and still complete the level.