Two trains, A and B, stand at opposite ends of a railway 250 miles long. They set off toward each other at the same moment, A at 10 miles per hour and B at 15 miles per hour. The instant they start, a fly resting on the front of train A takes off at 20 miles per hour and shuttles between the two trains without stopping until they collide. How many miles does the fly cover?
Von Neumann heard the problem, summed the infinite series in his head, and answered 200 miles in less than a second.
Given the length D of the railway, the speeds A and B of the two trains, and the speed F of the fly, write a program that computes the distance the fly covers.
The first line contains the number of test cases P (1≤P≤1000).
Each of the next P lines holds one test case: five numbers N, D, A, B, F separated by spaces. N is the test case number, D is the length of the railway (10≤D≤1000), A and B are the speeds of the two trains (1≤A,B≤40), and F is the speed of the fly (A≤B<F≤50). D, A, B, F are real numbers with at most two digits after the decimal point.
For each test case, print one line with the test case number N and the distance the fly covers before the trains collide, separated by a space.
Round the distance at the seventh digit after the decimal point and print exactly six digits after the decimal point, trailing zeros included. No input lands on a rounding boundary.