#P9630. [ICPC 2020 Nanjing R] Interested in Skiing

    ID: 8981 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 6 Uploaded By: Tags>2020Special JudgeO2优化XCPC南京

[ICPC 2020 Nanjing R] Interested in Skiing

题目描述

Kotori is interested in skiing. The skiing field is an infinite strip going along yy-axis on the 2-dimensional plane where all points (x,y)(x, y) in the field satisfies mxm-m \le x \le m. When skiing, Kotori cannot move out of the field, which means that the absolute value of his xx-coordinate should always be no more than mm. There are also nn segments on the ground which are the obstacles and Kotori cannot move across the obstacles either.

Kotori will start skiing from (0,1010101010)(0, -10^{10^{10^{10^{10}}}}) (you can regard this yy-coordinate as a negative infinity) and moves towards the positive direction of the yy-axis. Her vertical (parallel to the yy-axis) speed is always vyv_y which cannot be changed, however she can control her horizontal (parallel to the xx-axis) speed in the interval of [vx,vx][-v_x, v_x]. The time that Kotori changes her velocity can be neglected.

Your task is to help Kotori calculate the minimum value of vxv_x^* that once vx>vxv_x>v_x^* she can safely ski through the skiing field without running into the obstacles.

输入格式

There is only one test case in each test file.

The first line of the input contains three positive integers nn, mm and vyv_y (1n1001 \le n \le 100, 1m1041 \le m \le 10^4, 1vy101 \le v_y \le 10), indicating the number of obstacles, the half width of the skiing field and the vertical speed.

For the following nn lines, the ii-th line contains four integers x1x_1, y1y_1, x2x_2 and y2y_2 (mx1,x2m-m \le x_1, x_2 \le m, 104y1,y2104-10^4 \le y_1, y_2 \le 10^4, x1x2x_1 \ne x_2 or y1y2y_1 \ne y_2) indicating the ii-th obstacle which is a segment connecting point (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), both inclusive (that is to say, these two points are also parts of the obstacle and cannot be touched). It's guaranteed that no two obstacles intersect with each other.

输出格式

Output one line containing one number indicating the minimum value of vxv_x^*. If it is impossible for Kotori to pass through the skiing field, output -1 (without quotes) instead.

Your answer will be considered correct if and only if its absolute or relative error does not exceed 10610^{-6}.

3 2 1
-2 0 1 0
-1 4 2 4
0 1 0 3
1.000000000000000
2 1 2
-1 0 1 0
1 1 0 1
-1
2 3 7
-3 0 2 2
3 1 -2 17
1.866666666666666
1 100 1
-100 0 99 0

0.000000000000000