Optimal Quadratic Function

아직 제출이 없습니다시간 제한10초메모리 제한1024 MB

문제

Two variables xx and yy are dependent to each other with the relation y=f(x)y=f(x) where ff is a quadratic function: f(x)=ax2+bx+cf(x) = a x^2 + b x + c with some real numbers aa, bb, and cc. However, the function ff is unknown and you want to figure out its best estimation.

For that purpose, you have obtained NN observed yy-values y_1,y_2,,y_Ny\_1, y\_2, \ldots, y\_N for xx-values x_1,x_2,,x_Nx\_1, x\_2, \ldots, x\_N, respectively, by experiments. The observed values y_1,y_2,,y_Ny\_1, y\_2, \ldots, y\_N contain some errors from several sources, so it is unlikely that all of them are exact function values for a certain quadratic function. Therefore, you need to find an optimal estimation of the function ff that minimizes the error.

For any quadratic function ff, the error of a data pair (x_i,y_i)(x\_i, y\_i) is defined to be (y_if(x_i))2(y\_i-f(x\_i))^2, and the error of ff is defined to be the maximum of these errors over all the NN data pairs. Write a program that, given the NN observed data pairs, finds out an optimal estimation of function ff that minimizes the error and prints out the error value.

입력

The first line contains an integer TT, the number of test cases (1T100,0001 \le T \le 100\\,000). The test cases follow.

The first line of each test case contains an integer NN, the number of observed data pairs (1N100,0001 \le N \le 100\\,000).

Each of the next NN lines contains two integers x_ix\_i and y_iy\_i, the ii-th data pair (106x_i,y_i106-10^6 \le x\_i, y\_i \le 10^6).

The sum of NN over all test cases does not exceed 200,000200\\,000.

출력

For each test case, print a line with a real number: the minimum possible error value.

The answer will be considered correct if its absolute or relative error is within 10610^{-6}.