题目描述
Problem Description
Kotori is interested in skiing. The skiing field is an infinite strip along the $y$-axis on the 2-dimensional plane, where all points $(x, y)$ in the field satisfy $-m \le x \le m$. When skiing, Kotori cannot leave the field, meaning her $x$-coordinate's absolute value should always be within $m$. There are also $n$ segments on the ground which are obstacles, and Kotori cannot cross these obstacles.
Kotori will start skiing from $(0, -10^{10^{10^{10^{10}}}})$ (you can consider this $y$-coordinate as negative infinity) and move towards the positive direction of the $y$-axis. Her vertical speed (parallel to the $y$-axis) is always $v_y$, which remains constant, but she can control her horizontal speed (parallel to the $x$-axis) within the interval $[-v_x, v_x]$. The time Kotori takes to change her velocity is negligible.
Your task is to help Kotori calculate the minimum value of $v_x^*$, such that once $v_x > v_x^*$, she can safely ski through the field without encountering any obstacles.
Input Format
There is only one test case in each test file.
The first line of input contains three positive integers $n$, $m$, and $v_y$ ($1 \le n \le 100$, $1 \le m \le 10^4$, $1 \le v_y \le 10$), representing the number of obstacles, the half-width of the skiing field, and the vertical speed, respectively.
The next $n$ lines each contain four integers $x_1, y_1, x_2, y_2$ ($-m \le x_1, x_2 \le m$, $-10^4 \le y_1, y_2 \le 10^4$, $x_1 \ne x_2$ or $y_1 \ne y_2$), describing the $i$-th obstacle, which is a segment connecting points $(x_1, y_1)$ and $(x_2, y_2)$, both inclusive. It is guaranteed that no two obstacles intersect.
Output Format
Output a single line containing a number representing the minimum value of $v_x^*$. If it is impossible for Kotori to pass through the skiing field, output -1 (without quotes).
Your answer will be considered correct if and only if its absolute or relative error does not exceed $10^{-6}$.
Sample Input and Output
Sample Input #1
3 2 1
-2 0 1 0
-1 4 2 4
0 1 0 3
Sample Output #1
1.000000000000000
Sample Input #2
2 1 2
-1 0 1 0
1 1 0 1
Sample Output #2
-1
Sample Input #3
2 3 7
-3 0 2 2
3 1 -2 17
Sample Output #3
1.866666666666666
Sample Input #4
1 100 1
-100 0 99 0
Sample Output #4
0.000000000000000
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分