Problem: 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 $x$-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 $x$-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.

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

<image>

[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 $30$. Each dataset is formatted as follows.

> $N$
> $X_1$ $R_1$
> :
> :
> $X_N$ $R_N$

The first line of a dataset contains a single integer $N$ ($1 \le N \le 50{,}000$), the number of circles that constitute Circles Island. Each of the following $N$ lines describes a circle. The $(i+1)$-st line contains two integers $X_i$ ($-100{,}000 \le X_i \le 100{,}000$) and $R_i$ ($1 \le R_i \le 100{,}000$). $X_i$ denotes the $x$-coordinate of the center of the $i$-th circle and $R_i$ denotes the radius of the $i$-th circle. The $y$-coordinate of every circle is $0$, that is, the center of the $i$-th circle is at ($X_i$, $0$).

You can assume the followings.

* For all $i$ ($1 \le i \le N-1$), $X_i$ is strictly less than $X_{i+1}$.
* For all $i$ ($1 \le i \le N-1$), the $i$-th circle and the $(i+1)$-st circle have at least one common point ($X_{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 $10^{-4}$.

Sample Input


2
0 8
10 8
2
0 7
10 7
0

Output for the Sample Input


12.489995996796796
9.899494936611665





Example

Input

2
0 8
10 8
2
0 7
10 7
0


Output

12.489995996796796
9.899494936611665

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<double, double> pd;
typedef pair<ll, ll> pl;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;

typedef double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef vector<P> VP;
const D EPS = 1e-9;
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

D dot(P a, P b) {
  return (conj(a)*b).X;
}

P proj(P a1, P a2, P p) {
  return a1 + dot(a2-a1, p-a1)/norm(a2-a1) * (a2-a1);
}

VP crosspointLC(P a1, P a2, P c, D r) {
    VP ps;
    P ft = proj(a1, a2, c);
    if (!GE(r*r, norm(ft-c))) return ps;

    P dir = sqrt(max(r*r - norm(ft-c), 0.0)) / abs(a2-a1) * (a2-a1);
    ps.push_back(ft + dir);
    if (!EQ(r*r, norm(ft-c))) ps.push_back(ft - dir);
    return ps;
}

int n;
double x[50000], r[50000];

void solve() {
    rep(i,n) {
        cin >> x[i] >> r[i];
    }
    double le = 0.0, ri = 200000.0;
    rep(i,100) {
        double mid = (le + ri) / 2.0;
        P ho = P(0.0, mid), ge = P(1.0, mid);
        double nowl = -1000000.0, nowr = -1000000.0;
        bool ok = false;
        vector<pd> vd;
        rep(j,n) {
            VP vp = crosspointLC(ho, ge, P(x[j],0.0), r[j]);
            if (vp.size() != 2) continue;
            if (vp[0].X < vp[1].X) {
                vd.push_back(pd(vp[0].X, vp[1].X));
            } else {
                vd.push_back(pd(vp[1].X, vp[0].X));
            }
        }
        sort(vd.begin(), vd.end());
        rep(j,vd.size()) {
            if (nowr < vd[j].first) {
                nowl = vd[j].first;
                nowr = vd[j].second;
            } else {
                nowr = max(nowr, vd[j].second);
            }
            if (GE(nowr-nowl,2*mid)) {
                ok = true;
                break;
            }
        }
        if (ok) le = mid;
        else ri = mid;
    }
    printf("%.9f\n", le*2);
}

int main() {
    while (cin >> n) {
        if (n == 0) break;
        solve();
    }
}