C

Divide the Land

Input: Standard Input

Output: Standard Output

 

Mr. Rahim Mia has some lands of trapezium shape. He wants to divide each of the lands between his two sons so that everyone gets equal area in every land. But as Mr. Rahim is not so good at mathematics, he is confused how to divide the lands equally. He decided to divide the land with a line parallel to the parallel lines of the trapezium. Yet he is getting problem to determine the points to draw the line. So he came to you. Please write a program for him that finds the distance of the points along the non-parallel lines of the trapezium to from the longer parallel line that will divide the land into two equal parts in terms of area. For example, consider the following figure, you have to find the lengths AE and BF so that ABFE and EFCD are equal in area and EF||AB given AB, BC, CD, DA.

Input

The first line of Input will be a number mentioning the number of lands Mr. Rahim has (at most 500). Each of the following numbers is description of Rahim’s land.  Each description will consist of 4 positive integers mentioning AB, CD, AD and BC (less than 10000). You may assume that AB||CD and AB > CD. You may also assume that all of Rahim’s lands are trapezium shaped and has a positive area.

 

Output

For each of the lands you should output the number of the land and then the lengths AE and BF as two real numbers. Up to 1e-6 error in your output will be acceptable.

                

Sample Input                              Output for Sample Input

2

15 12 9 10

12 6 5 5

Land #1: 4.250767 4.723074

Land #2: 2.094306 2.094306

 

Problem setter: Md. Towhidul Islam, Special Thanks: Md. Arifuzzaman Arif