Score : $600$ points
There are $N$ lines in a two-dimensional plane. The $i$-th line is $A_i x + B_i y + C_i = 0$. It is guaranteed that no two of the lines are parallel.
In this plane, there are $\frac{N(N-1)}{2}$ intersection points of two lines, including duplicates. Print the distance between the origin and the $K$-th nearest point to the origin among these $\frac{N(N-1)}{2}$ points.
Input is given from Standard Input in the following format:
$N$ $K$ $A_1$ $B_1$ $C_1$ $A_2$ $B_2$ $C_2$ $\vdots$ $A_N$ $B_N$ $C_N$
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 $10^{-4}$.
3 2 1 1 1 2 1 -3 1 -1 2
2.3570226040
Let us call the $i$-th line Line $i$.
Therefore, the second nearest intersection point is $(\frac{1}{3},\frac{7}{3})$, and $\frac{5\sqrt{2}}{3}$ 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