PivotOJ

Scholar's Lawn

시간 제한: 1000ms메모리 제한: 1024MB출처: ICPC ECNA 2020-2021BOJ 21158

문제

Famously at Cambridge, and often copied at other schools, is the tradition of the "Scholar's Lawn" -- an area of grass where Fellows of the school, or other distinguished entities, can walk, but regular students cannot.

So, if a student spies a Fellow walking across campus, and wishes to ambush \ldots, er, meet up with them, the student is restricted to walking along a set of narrow paved walkways laid out in various places within the grassy areas, hoping to reach the Fellow's path at the same time or before the Fellow arrives. At the end of the Fellow's path is the Sacred Grove of Academe, off-limits to students, so if the Fellow reaches it before the student, the student is out of luck.

For instance, Figure 1 shows an area of lawn together with the fixed set of paved walkways (solid lines) and the path taken by a Fellow of the university (dotted line); FF and SS denote the initial positions of the Fellow and student, respectively. If both travel at the same speed (say, one meter per second), then after 17.6776717.67767 seconds the Fellow will find the student waiting to have a chat at location (22.5,12.5)(22.5,12.5) (marked by the small open circle "\large\circ").

Figure 1: Sample Input 1

입력

Input begins with an integer nn, 1n5001 \le n \le 500, the number of straight-line walkways. There will then follow nn lines, each with 44 integers, denoting the (x,y)(x,y) coordinates of the endpoints of each walkway. After that is a line containing three real values xsx_s, ysy_s, vsv_s, where (xs,ys)(x_s,y_s) is the position of the student and vsv_s, 0<vs10000 < v_s \leq 1\,000, is the student's walking speed. The point (xs,ys)(x_s,y_s) is guaranteed to lie on one of the nn paved walkways. The final line contains 55 numbers. The first 44 numbers are real numbers x1fx_{1f}, y1fy_{1f}, x2fx_{2f}, y2fy_{2f}, 10000x1f,y1f,x2f,y2f10000-10\,000 \le x_{1f}, y_{1f},x_{2f},y_{2f} \le 10\,000, giving the starting position (x1f,y1f)(x_{1f}, y_{1f}) of the Fellow and the ending position (x2f,y2f)(x_{2f}, y_{2f}) of the Fellow (the last point where the student can reach the Fellow). The final number is a real value vfv_f, 0<vf10000 < v_f \leq 1\,000, giving the Fellow's walking speed. All real-valued inputs will have at most four digits after the decimal point.

The Fellow always walks in a straight line.  The student can walk only along walkways, which are assumed to have zero width. If a walkway intersects with another walkway or the Fellow's path, it will do so at a single point. Collinear walkways never intersect one another; similarly, if the Fellow's path and a walkway are collinear, they will not intersect.

출력

Output the earliest time tt when the student's position and the Fellow's position can coincide at an intersection of a walkway and the Fellow's path. If this is impossible, output the word "Impossible". Numeric answers should be accurate to within an absolute or relative error of 10610^{-6}.

예제

예제 1

입력
7
5 5 35 5
35 0 15 20
30 0 30 10
30 10 35 10
35 10 35 15
35 15 30 15
30 15 30 30
30.0 0.0 1.0
10 0 40 30 1.0
출력
17.67766953

예제 2

입력
7
5 5 35 5
35 0 15 20
30 0 30 10
30 10 35 10
35 10 35 15
35 15 30 15
30 15 30 30
30.0 0.0 1.0
10 0 40 30 1.2
출력
Impossible
코드를 제출하려면 로그인하세요.