409905: GYM103831 D Labyrinth

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Labyrinthtime limit per test2 secondsmemory limit per test64 megabytesinputlabyrinth.inoutputlabyrinth.out

Vasya is stuck in a labyrinth. The labyrinth is a non-self-intersecting polygon with N vertices and sides parallel to the coordinate axes. In the evening Vasya has a programming practice, so he wants to escape from the labyrinth as quickly as possible. He is at the point (Xs, Ys) inside the labyrinth, and the exit is at the point (Xe, Ye). For simplicity, let us represent Vasya as a square with side of A units. The sides of the square are always parallel to the axes. Vasya is considered to have escaped when his center reaches the exit point. Find the minimal escape time. Vasya's speed is V units/sec. If Vasya cannot escape, output -1.

Input

The first line holds two real numbers Xs and Ys (0 ≤ Xs, Ys ≤ 100). The next line holds two real numbers Xe and Ye (0 ≤ Xe, Ye ≤ 100). The following two lines hold real numbers A and V (0.5 ≤ A, V ≤ 10), respectively. The following lines describe the polygon: a single integer N (1 ≤ N ≤ 100) on a line by itself, and each of the following N lines holds a pair of real numbers, Xi and Yi being the coordinates of a vertex (0 ≤ Xi, Yi ≤ 100). All the reals are guaranteed to give an integer when multiplied by 2.

Output

Output the answer on a single line. Your answer will be considered correct if its relative error does not exceed 10 - 6.

Scoring

Points for all the tests are awarded independently.

ExampleInput
1.5 4.5
4.5 1.5
1
1
6
0 0
0 6
3 6
3 3
6 3
6 0
Output
4.472135955

加入题单

算法标签: