Rails
An important parameter of a railway is the track gauge — the distance between the two rails on which a train travels. This parameter determines the types of trains and other machines that can operate on the railway.
Recently, a space expedition to planet RCC-0805 discovered railways on this planet. A railway depot was even found, but the track gauge has not yet been determined. The challenge is that the railways on this planet were laid without sleepers, making it difficult to determine which rails correspond to each other.
You are given a plan of the rail layout at the railway depot. For simplicity, assume the area is an infinite plane, and each rail is represented as a line. Your task is to find the minimum track gauge (d), such that the rails can be paired in a way that each pair is parallel and the distance between them is exactly (d).
Input
The first line contains an integer (n) ((1 n 2000)). Each of the following (2n) lines contains four integers (x_i, 1), (y_i, 1), (x_i, 2), (y_i, 2) — the coordinates of two distinct points through which the rail passes. All coordinates do not exceed 1000 in absolute value. The lines corresponding to different rails do not coincide.
Output
Output a real number — the minimum possible track gauge. It must be determined with an accuracy of at least (10^-6).
If it is impossible to pair the rails with any track gauge while meeting the problem's requirements, output the number (-1).