Scorched Earth

No attempts yetTime limit1sMemory limit256 MB

Problem

General Arne Heisveis has nothing to do. The Norwegian defence budget was cut again and again, so his office is empty of work, and the generals now spend the whole day on an old computer game called Scorched Earth. Arne is competitive but bad at the game, so he wants a program that does the arithmetic for him.

A match is a duel between two tanks, and the only weapon is a small missile. The players fire in turn, each choosing an angle and an initial speed. The initial speed can never be negative and can never exceed 300.0300.0 m/s. While the missile flies, gravity pulls it down with 9.8 m/s29.8\ \mathrm{m/s^2} and the wind gives it a constant acceleration along the x-axis.

Arne always finds an angle that clears every mountain on the battlefield, so the terrain is not part of the input. The speed is what he needs. If the tank sits at (xu,yu)(x_u, y_u), the firing angle is dd degrees and the initial speed is vv, then after tt seconds the missile is at

x(t)=xu+(vcosd)t+wt22,y(t)=yu+(vsind)t9.8t22x(t) = x_u + (v \cos d)\,t + \frac{w t^2}{2}, \qquad y(t) = y_u + (v \sin d)\,t - \frac{9.8 t^2}{2}

where ww is the acceleration from the wind. The shot hits the opponent at (xo,yo)(x_o, y_o) when x(t)=xox(t) = x_o and y(t)=yoy(t) = y_o hold at the same time t>0t > 0.

Input

The first line has the number of test cases nn (1n10001 \le n \le 1000). Each of the next nn lines has six real numbers xux_u, yuy_u, xox_o, yoy_o, ww, dd. Your tank is at (xu,yu)(x_u, y_u) and the opponent's tank is at (xo,yo)(x_o, y_o), measured in meters, with 0.0xu,xo1000.00.0 \le x_u, x_o \le 1000.0 and 0.0yu,yo800.00.0 \le y_u, y_o \le 800.0. The wind accelerates the missile along the x-axis by w m/s2w\ \mathrm{m/s^2}, with 2.0w2.0-2.0 \le w \le 2.0. The angle Arne chose is dd degrees, with 0d1800 \le d \le 180. An angle d=0d = 0 fires along the increasing x-axis, and d=90d = 90 fires straight up.

Output

Print one line for each test case. If an initial speed between 00 and 300.0300.0 m/s hits the opponent, print that speed with exactly 5 digits after the decimal point. If several speeds hit, print the smallest one. If no speed in that range hits, print impossible.