atcoder#ABC263H. [ABC263Ex] Intersection 2
[ABC263Ex] Intersection 2
Score : points
Problem Statement
There are lines in a two-dimensional plane. The -th line is . It is guaranteed that no two of the lines are parallel.
In this plane, there are intersection points of two lines, including duplicates. Print the distance between the origin and the -th nearest point to the origin among these points.
Constraints
- $-1000 \le |A_i|,|B_i|,|C_i| \le 1000(1 \le i \le N)$
- No two of the lines are parallel.
- or .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a real number representing the answer.
Your output is considered correct when its absolute or relative error from the judge's output is at most .
3 2
1 1 1
2 1 -3
1 -1 2
2.3570226040
Let us call the -th line Line .
- The intersection point of Line and Line is , whose distance to the origin is .
- The intersection point of Line and Line is , whose distance to the origin is .
- The intersection point of Line and Line is , whose distance to the origin is .
Therefore, the second nearest intersection point is , and should be printed.
6 7
5 1 9
4 4 -3
8 -1 2
0 1 -8
4 0 -4
2 -3 0
4.0126752298