Welcome to ZOJ
Select Problem
ZOJ Problem Set - 2607

Time Limit: 10 Seconds      Memory Limit: 32768 KB      Special Judge

John is working in a secret laboratory. Now he is preparing a special experiment involving four dangerous liquid substances with code names 'A', 'B', 'C', and 'D'.

A special container is used to keep the substances. The container is made of a special strong glass. It consists of four sections: 'A', 'B', 'C', and 'D' as shown on the picture.

Each substance is to be kept in its own part, marked with the letter that coincides with the code name of the substance. Since the container must be transported using standard carts, the height of the container is fixed and must be equal to one inch.

John knows, that he needs a, b, c, and d cubic inches of substances 'A', 'B', 'C', and 'D' respectively. Now he wonders what can be the minimal possible total square of the container so that the required volume of each substance would fit its section. Help him to find it out.


Each test case contains four positive integral numbers a, b, c, and d, not exceeding 106. Proceed until the end of file.


For each case, output the answers in two consecutive lines. On the first line print S - the minimal possible square of the container. On the next line print four real numbers p1, p2, q1, and q2 - the dimensions of the container sections as shown on the picture. Print at least six digits after the decimal point. Do not print any blank lines.

Sample Input

5 6 8 7
2 1 1 1

Sample Output

1.6641005886 1.9414506867 4.1206300292 3.6055512754
1.41421356237309505000 1.00000000000000000000 1.41421356237309505000 1.00000000000000000000

Author: Andrew Stankevich
Source: Andrew Stankevich's Contest #7
Submit    Status