eolymp
bolt
Try our new interface for solving problems
Problems

Largest Empty Circle on a Segment

Largest Empty Circle on a Segment

We are given \textbf{N} line segments on the \textbf{2D} plane. We want to find the maximum radius of an empty circle whose center coordinates (\textbf{xc}, \textbf{yc}) are constrained as follows: \begin{itemize} \item \textbf{0} ≤ \textbf{xc} ≤ \textbf{L} \item \textbf{yc} = \textbf{0} \end{itemize} A circle is empty if no part of a segment is located strictly inside of it (thus, a segment may touch the circle, but may not intersect with the interior of the circle). \includegraphics{https://static.e-olymp.com/content/3d/3d57fba2b797d0844f7e644c4fe187fee7ff227b.jpg} \InputFile The first line of the input file contains the number of test cases \textbf{T}. The test cases are described next. The first line of a test case contains the integer numbers \textbf{N} and \textbf{L} (\textbf{1} ≤ \textbf{N} ≤ \textbf{2000} and \textbf{0} ≤ \textbf{L} ≤ \textbf{10000}). The next \textbf{N} lines of the test case contain \textbf{4} integers each, describing the coordinates of the endpoints of a segment: \textbf{xa}, \textbf{ya}, \textbf{xb} and \textbf{yb}. The coordinates of the endpoints of the segment are (\textbf{xa}, \textbf{ya}) and (\textbf{xb}, \textbf{yb}). All the coordinates are between \textbf{-20000} and \textbf{+20000}. Every two consecutive numbers on the same line are separated by a single blank. \OutputFile For each test case print a line containing a real number \textbf{R}, denoting the maximum radius of an empty circle whose center obeys the constraints. The number must be printed with \textbf{3} decimal digits (the number must be rounded up or down according to the usual rounding rules).
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
4 10
1 1 10 3
5 3 9 1
3 1 4 1
8 3 11 -3
Output example #1
2.118