Rescuer

3.2

32 votes
Ready, Algorithms, Medium, Open, Approved
Problem

Today is a very hot day for rescuer Bob. And right now he's just noticed new sinking drunk man in the sea! Let's assume that resort is Euclidean plane and the shoreline is y=0 line. The sea is everything above y=0. And respectively everything below y=0 is a beach. The Bob's speed on the land equals to v1, and his speed while swimming equals to v2.

Now Bob is at point (x1, y1) and the sinking man is at point (x2, y2). What is the minimum time Bob need to get to the poor fellow and rescue his life?

In one test file you have to handle T test cases.

Constraints

T <= 100
-109 <= x1, x2, y1, y2, v1, v2 <= 109
y1 < 0
y2, v1, v2 > 0

Input

The first line contains one integer T denoting the number of test cases. The following T lines describe test cases.

The first and the only line of each test case contains 6 space-separated integers: x1, y1, x2, y2, v1, v2

Output

Output the minimum required time with exactly 5 digits after decimal point.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?