Limits 1s, 128 MB

It is Argentina vs Croatia in the football world cup semifinal of 2022 in a parallel universe.

The football field can be considered as an infinite 22- dimensional plane. Lionel Messi of Argentina has the ball. He is at coordinate (x,0)(x,0). Joško Gvardiol, a defender of Croatia is at (x1,0)(x-1,0). At any moment, Gvardiol runs directly towards Messi at speed 11 unit per second. Messi knows the movement strategy of Gvardiol. Messi himself has a maximum speed of vv unit per second.

Gvardiol will tackle Messi if the distance between them becomes strictly less than 11 unit. Gvardiol has a choice to foul Messi at a moment when Messi moves from a position which is more than 1 unit away to a position which is exactly 11 unit away from Gvardiol. A dribble is a path on the field which Messi can take to move to coordinate (0,0)(0,0) without getting tackled or fouled.

Messi does not know if Gvardiol intends to foul or not. So to be safe, he plans his dribble assuming that Gvardiol will foul him given the chance.

A dribble XX is called boring if Messi can make a dribble shorter than XX if he knows beforehand that Gvardiol won’t foul.

Messi wants to know the length of the shortest dribble which is not boring. It can be proved that such a dribble exists under the given constraints.


First line contains an integer TT (1T5×104)(1 \leq T \leq 5 \times 10^4 ), the number of test cases.
Each of the next TT lines contains two space separated floating point numbers xx (2x100)(2 \leq x \leq 100) and vv (1<v100)(1 \lt v \leq 100). Both numbers have 55 digits after decimal.


Print the answer for each case in a separate line. Your answer is considered correct if its absolute or relative error does not exceed 10610^{-6}. Formally, let your answer be AA, and the jury's answer be BB. Your answer is accepted if and only if ABmax(1,B)\frac{\lvert A-B \rvert}{\max(1, B)} \leq 10610^{-6}.


2.50000 2.60000
10.00000 100.00000


Login to submit.


100% Solution Ratio
Masum_BillaEarliest, 10M ago
Masum_BillaFastest, 0.1s
Masum_BillaLightest, 5.4 MB
Masum_BillaShortest, 832B
Toph uses cookies. By continuing you agree to our Cookie Policy.