The Balloon Kingdom is under attack now! The beautiful princess of The Balloon Kingdom is captured to a tower. Now the Balloon king orders the red balloons to save princess.
Now imagine a 2-dimensional world. The princess is at Point (1000,0), and The red balloons start from the Point (0,0). Every t seconds a red balloon starts his way to the place of the princess along the x-axis in speed v. When at least 200 red balloons arrive at the place of princess, they can rescue the princess and bring her back to The Balloon Kingdom.
But the mission of saving the princess is not easy. There is a evil monkey positioned at Point (x,y). he has a particular attack range, which is a circle with radius r (inclusive of the circumference). He always attacks the red balloon that is nearest to the princess. Furthermore, any two consecutive attacks has a time interval u at least. As soon as the evil monkey has some target to attack, he will always attack immediately. When a red balloon is attacked, he perishes and disappears.
Now we want to know whether the princess of The Balloon Kingdom can be saved (in possibly a very long time). And if the princess can be saved, how much time is required after the first red balloon starts his way.
The input consists of multiple test cases. The first line of input contains an positive integer T (T ≤ 10000), which denotes the number of test cases.
For each test case, There are six integer numbers separated by a space in a line, corresponding to t,v,x,y,r,u in the problem description, respectively.(1≤t,v,r,u≤1000,|x|,|y| ≤ 1000)
Note that the attack range of the evil monkey will never cover the starting point of red balloon, nor the tower where the princess is imprisoned.
For each test case, print a line containing -1 if the princess can’t be saved. Otherwise print the time needed to save the princess (rounded to exactly 6 decimal places).
1 1 1 1 2 1 1
1199.000000
Migrated from old NTUJ.
dreamoon
No. | Testdata Range | Score |
---|