#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N;
	while (cin >> N, N) {
		vector<double> X(N), R(N);
		for (int i = 0; i < N; ++i) {
			cin >> X[i] >> R[i];
		}
		double l = 0.0, r = 2.0e+5;
		for (int rep = 0; rep < 40; ++rep) {
			double m = (l + r) / 2;
			vector<double> sl, sr, plist;
			for (int i = 0; i < N; ++i) {
				if (R[i] >= m / 2) {
					double delta = sqrt(double(R[i]) * R[i] - m * m / 4);
					sl.push_back(X[i] - delta);
					sr.push_back(X[i] + delta);
				}
			}
			plist.insert(plist.end(), sl.begin(), sl.end());
			plist.insert(plist.end(), sr.begin(), sr.end());
			sort(plist.begin(), plist.end());
			int SN = sl.size();
			vector<int> imos(2 * SN);
			for (int i = 0; i < SN; ++i) {
				int idl = lower_bound(plist.begin(), plist.end(), sl[i]) - plist.begin();
				int idr = lower_bound(plist.begin(), plist.end(), sr[i]) - plist.begin();
				++imos[idl];
				--imos[idr];
			}
			int pre = 0, sum = 0;
			bool ok = false;
			for (int i = 0; i < 2 * SN; ++i) {
				sum += imos[i];
				if (sum == 0) {
					double len = plist[i] - plist[pre];
					if (len >= m) ok = true;
					pre = i + 1;
				}
			}
			if (ok) l = m;
			else r = m;
		}
		cout.precision(15);
		cout << r << '\n';
	}
	return 0;
}
