#icpc2014autumne. [icpc2014autumn_e]Square in Circles

[icpc2014autumn_e]Square in Circles

MathJax.Hub.Config({ tex2jax: { inlineMath: [["","",""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }

Problem Statement

Circles Island is known for its mysterious shape: it is a completely flat island with its shape being a union of circles whose centers are on the xx-axis and their inside regions.

The King of Circles Island plans to build a large square on Circles Island in order to celebrate the fiftieth anniversary of his accession. The King wants to make the square as large as possible. The whole area of the square must be on the surface of Circles Island, but any area of Circles Island can be used for the square. He also requires that the shape of the square is square (of course!) and at least one side of the square is parallel to the xx-axis.

You, a minister of Circles Island, are now ordered to build the square. First, the King wants to know how large the square can be. You are given the positions and radii of the circles that constitute Circles Island. Answer the side length of the largest possible square.

NN circles are given in an ascending order of their centers' xx-coordinates. You can assume that for all ii (1leileN11 \\le i \\le N-1), the ii-th and (i+1)(i+1)-st circles overlap each other. You can also assume that no circles are completely overlapped by other circles.

fig.1 : Shape of Circles Island and one of the largest possible squares for test case #1 of sample input


Input

The input consists of multiple datasets. The number of datasets does not exceed 3030. Each dataset is formatted as follows.

NN
X_1X\_1 R_1R\_1
:
:
X_NX\_N R_NR\_N

The first line of a dataset contains a single integer NN (1leNle50,0001 \\le N \\le 50{,}000), the number of circles that constitute Circles Island. Each of the following NN lines describes a circle. The (i+1)(i+1)-st line contains two integers X_iX\_i (100,000leX_ile100,000-100{,}000 \\le X\_i \\le 100{,}000) and R_iR\_i (1leR_ile100,0001 \\le R\_i \\le 100{,}000). X_iX\_i denotes the xx-coordinate of the center of the ii-th circle and R_iR\_i denotes the radius of the ii-th circle. The yy-coordinate of every circle is 00, that is, the center of the ii-th circle is at (X_iX\_i, 00).

You can assume the followings.

  • For all ii (1leileN11 \\le i \\le N-1), X_iX\_i is strictly less than X_i+1X\_{i+1}.
  • For all ii (1leileN11 \\le i \\le N-1), the ii-th circle and the (i+1)(i+1)-st circle have at least one common point (X_i+1X_ileR_i+R_i+1X\_{i+1} - X\_i \\le R\_i + R\_{i+1}).
  • Every circle has at least one point that is not inside or on the boundary of any other circles.

The end of the input is indicated by a line containing a zero.

Output

For each dataset, output a line containing the side length of the square with the largest area. The output must have an absolute or relative error at most 10410^{-4}.


Sample Input

2
0 8
10 8
2
0 7
10 7
0```

### Output for the Sample Input

```plain
12.489995996796796
9.899494936611665```

* * *

### Source Name

JAG Practice Contest for ACM-ICPC Asia Regional 2014

* * *