题目描述
Read problem statement in Mandarin chinese and Vietnamese.
Suzumo is the coach of the ChefLand OI team. Physical condition is very important in any olympiad, so he wants to make the children run a bit as a warmup.
The team consists of $N$ children numbered $1$ through $N$ standing at some positions on the $x$-axis. For each valid $i$, the initial $x$-coordinate of the $i$-th kid is $x_{i}$, the running velocity of the $i$-th kid is constant and equal to $v_{i}$.
Suzumo wants to assign a running direction (left or right, i.e. in the direction of decreasing or increasing $x$-coordinate) to each kid; the children start running at time $0$ in the assigned directions. Afterwards, Suzumo will measure the smallest time $t$ at which some kid passes another one. Help Suzumo compute the maximum time $t$ if he can assign the directions arbitrarily!
Note: Child $i$ passes child $j$ at time $t_{ij}$ if their coordinates satisfy $x_{i} < x_{j}$ at any time $t < t_{ij}$ and $x_{i} > x_{j}$ at any time $t > t_{ij}$, or if they satisfy $x_{i} > x_{j}$ at any time $t < t_{ij}$ and $x_{i} < x_{j}$ at any time $t > t_{ij}$.
------ Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first line of each test case contains a single integer $N$.
$N$ lines follow. For each valid $i$, the $i$-th of these lines contains two space-separated integers $x_{i}$ and $v_{i}$.
------ Output ------
For each test case, print a single line containing one real number — the maximum possible time $t$, or $-1$ if it is possible to assign directions in such a way that no kid ever passes another. Your answer will be considered correct if it has an absolute or relative error less than or equal to $10^{-6}$.
------ Constraints ------
$1 ≤ T ≤ 100$
$1 ≤ N ≤ 50$
$1 ≤ x_{i}, v_{i} ≤ 10^{9}$ for each valid $i$
no two children have the same initial positions
----- Sample Input 1 ------
1
3
10 10
20 30
30 10
----- Sample Output 1 ------
0.5
----- explanation 1 ------
Example case 1: One optimal assignment of directions is left, right, right.
输入格式
见题面
输出格式
见题面