Given overlapping circles centered on the x-axis, find the side length of the largest axis-aligned square that fits inside their union.
Hard8GeometryBinary searchNo attempts yetTime limit8sMemory limit512 MBCircles Island is completely flat. Its shape is the union of several circles together with their interiors, and every circle has its center on the x-axis.
The king of Circles Island wants to build a large square plaza for the fiftieth anniversary of his accession, and he wants the plaza as large as possible. The whole plaza must lie on the island, and any part of the island may be used. The plaza must be a square, and one of its sides must be parallel to the x-axis.
You are given the center and the radius of every circle that forms the island. Report the side length of the largest square that can be built.
The circles are given in increasing order of the x-coordinate of their centers. For every i (1≤i≤N−1), circle i and circle i+1 overlap. No circle is completely covered by the other circles.

Figure 1. The island of the first example and one of its largest squares
The input has several datasets, at most 30 of them. Each dataset is in this format.
N
X1 R1
:
XN RN
The first line of a dataset has one integer N (1≤N≤50000), the number of circles that form the island. Line i of the next N lines has two integers Xi (−100000≤Xi≤100000) and Ri (1≤Ri≤100000). Circle i has its center at (Xi,0) and its radius is Ri.
You may assume the following.
The end of the input is a line that holds a single zero.
For each dataset, print the side length of the largest square on its own line, rounded to six digits after the decimal point.