#P7807. Kindergarten Physics

Kindergarten Physics

Kindergarten Physics

Problem Description

Zhang3 a participant of IPhO (Immortal Physics Olympiad). The 0th0^\mathrm{th} problem in the contest is as follows. There are two balls that weigh aa kg and bb kg respectively. They can be regarded as particles in this problem, as they are small enough. At the very beginning (i.e. t=0t = 0), the distance between two balls is dd km, and both of them are not moving. Assuming that only gravitation works in this system (no other objects or other forces considered). The two balls has started moving since t=0t = 0. Your task is to calculate the distance between them when t=t0t = t_0 (s). Help Zhang3 solve the problem! The following information might help when solving the problem.

  • Universal gravitation formula: F=Gm1m2/r2F = G \cdot m_1 \cdot m_2 / r ^ 2
  • Gravitational constant: $G = 6.67430 \times 10^{-11} \; \mathrm{m}^3 / (\mathrm{kg} \cdot \mathrm{s}^2)$

Input

The first line of the input gives the number of test cases T  (1T100)T \; (1 \le T \le 100). TT test cases follow. For each test case, the only line contains four integers a,b,d,t0  (1a,b,d,t0100)a, b, d, t_0 \; (1 \le a, b, d, t_0 \le 100), representing the mass of the two balls, the initial distance between them, and how much time the balls move. It is guaranteed that two balls will not collide within (t0+1)(t_0 + 1) seconds.

Output

For each test case, print a line with a real number xx, representing that the distance is xx km. Your answers should have absolute or relative errors of at most 10610^{-6}.

Sample Input

3
1 2 3 4
7 73 7 68
100 100 1 100

Sample Output

2.99999999999999999982
6.99999999999999974807
0.99999999999993325700

Source

2020 Multi-University Training Contest 4