SP4587 FENCE3 - Electric Fences

Description

Farmer John has decided to construct electric fences. He has fenced his fields into a number of bizarre shapes and now must find the optimal place to locate the electrical supply to each of the fences. A single wire must run from some point on each and every fence to the source of electricity. Wires can run through other fences or across other wires. Wires can run at any angle. Wires can run from any point on a fence (i.e., the ends or anywhere in between) to the electrical supply. Given the locations of all F (1

Input Format

The first line contains F, the number of fences. F subsequent lines each contain two X,Y pairs each of which denotes the endpoints of a fence.

Output Format

On a single line, print three space-separated floating point numbers, each with a single decimal place. Presume that your computer's output library will round the number correctly. The three numbers are: \* the X value of the optimal location for the electricity, \* the Y value for the optimal location for the electricity, and \* the total (minimum) length of the wire required.