Colonization
Time limit1sMemory limit1024 MB
Given N circles that must all touch each other externally, find the enclosed base area, or for N=3 the radius of a fourth circle that touches all three.
Statement
Long ago, in a distant galaxy, one faraway planet became too crowded, so its people decided to start colonizing. Without much deliberation, they chose the closest natural satellite as their first target: the Moon.
Huge shuttles brought autonomous modules to the Moon, where people would live. Each module is a bionic glass dome shaped like a circle with radius . It turned out the modules were not fully autonomous, so they had to be connected with passages. A passage can be built only when two domes stand flush against each other, that is, when their bounding circles touch externally.
The settlers want to build a lunar base. They must arrange the modules so that every pair of domes has a passage between them, and then compute the area of the resulting base. The area of the base includes not only the area under the modules but also the region that cannot be entered without passing through a dome.

The figure shows the modules as circles, the base area in gray, the passages as blue segments, and the new module to be added in red.
The settlement went on for many years. Then the Moon ran short of room, as the old planet had. The people decided to extend the bases. For a base made of three modules, they add a fourth module if it is small enough to fit between the other three. The new module must stand flush against all three, so new passages can be built. To manufacture it at the M-factory, they need the radius of this fourth dome.
Input
The first line contains , the number of domes (). The next line contains integers, the dome radii. Each radius is a positive integer not exceeding 1000. When , the last line may also contain the word 'INSERT'.
Output
If the base cannot be built as required, print . Otherwise, print the area of the base. If and the last input line contained 'INSERT', print the radius of the fourth dome on the next line. An answer is accepted if its absolute or relative error does not exceed .