Statement
There are people searching for treasure on the segment . They are numbered in increasing order of position, and person is located at coordinate .
Each person chooses exactly one direction, left or right, to search. Person can search up to distance from their position in the chosen direction. However, they cannot leave the segment or search past another person's position.
For convenience, let and . If person chooses left, their searched interval is
If person chooses right, their searched interval is
The region searched by all people is the union of their searched intervals. Choose a direction for every person to maximize the length of this union, and find that maximum length.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the maximum possible length of the searched region on one line.
Constraints
- .
- .
- .
- ().
- ().
- ().
- The sum of over all test cases does not exceed .
Subtasks
Samples
In the first test case, if the only person faces right, the interval from coordinate to is searched, with length .
In the second test case, one possible choice where both people face the same direction searches a region of length .