
ZOJ Problem Set  4071
Chiaki lives in a special universe where the the law of conservation of energy is quite different. Specifically, an equation $v^2+2gy=0$ can be found to describe the law, where $v$ is it's speed at point $(x, y)$ and $g$ is the gravitational acceleration which equals to $10$. At first, Chiaki is at origin $(0,0)$ without any kinetic energy and she would like to go to some point $(x,y)$ by some pipes. Chiaki has three pipes whose length are $l_1$, $l_2$ and $l_3$. She must use the pipes to build a tunnel, which is the route to the destination.
Chiaki would like to know whether it is possible to reach the destination and the minimum time to go to the destination if it is possible. InputThere are multiple test cases. The first line of the input contains an integer $T$ ($1 \le T \le 500$), indicating the number of test cases. For each test case: The first line contains five integers $x$, $y$, $l_1$, $l_2$ and $l_3$ ($1000 \le x, y \le 1000$, $1 \le l_1, l_2, l_3 \le 1000$)  the coordinators of the destination and the length of each pipe. OutputFor each test case, output an real number denoting the minimum time, or a string "Impossible!" (without the quotes) if Chiaki cannot reach the destination. Your answer will be considered correct if and only if the absolute error or relative error of your answer is less than $10^{8}$. Sample Input4 0 1 1 1 1 3 4 2 3 3 1000 0 499 499 3 0 8 10 2 1000 Sample OutputImpossible! 1.118033988749895 90.005448343698845 1.563516060678838 Author: LIN, Xi Source: Yet Another Xi Lin Contest 