Rails
Time limit2sMemory limit256 MB
Given 2n distinct lines, pair them so each pair has two parallel lines at the same distance d, and find the smallest such d.
Problem
An important parameter of a railway is its track gauge, the distance between the two rails a train runs on. This parameter determines which types of trains and other machines can run on the railway.
A recent space expedition to the planet RCC-0805 discovered that this planet has railways too. A railway depot was even found, but the track gauge could not yet be determined. The railways on this planet were laid without sleepers, so it is not always easy to tell which rails pair with each other.
You are given a layout of the rails on the territory of the railway depot. For simplicity, treat the territory as an infinite plane, with each rail represented by a line. Find the minimum track gauge such that the rails can be split into pairs where the two rails in each pair are parallel and the distance between them is .
Input
The first line contains an integer (). Each of the next lines contains four integers , , , , the coordinates of two distinct points the rail passes through. The absolute value of every coordinate does not exceed 1000. The lines corresponding to different rails do not coincide.
Output
Print the minimum possible track gauge as a real number. It must be determined with an error of at most .
If no track gauge allows the rails to be split into pairs satisfying the requirements of the problem, print .