PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000413. Hòa tan đa giác (Meltdown)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Hòa tan đa giác (Meltdown)

Meltdown

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

A flat polygonal piece of material is translated vertically downwards into a liquid at a constant speed vv metres per minute, without rotating. The liquid surface is at y=0y=0 and the piece initially lies entirely above it.

When exposed to the liquid, the material dissolves in its plane from all sides at speed cc metres per minute. The liquid occupies three-dimensional space, allowing it to enter concave recesses from outside the piece, as illustrated below.

Material and liquid

A target point P=(x,y)P=(x,y) is specified by its initial coordinates strictly inside the piece and moves with it until dissolved. Find the earliest time, measured from the beginning of the descent, when the liquid reaches PP.

Input

The first line contains five integers N,x,y,v,cN,x,y,v,c: the vertex count, the two target coordinates, the descent speed, and the dissolution speed. Each of the next NN lines contains two integers xi,yix_i,y_i, the initial coordinates of vertex ii. Vertices are listed counterclockwise.

Output

Print the earliest time in minutes, rounded to exactly four digits after the decimal point. In an exact halfway case, round upward.

Subtasks

  • Subtask 1 (20 points): 3≤N≤303\le N\le30; −100≤x,xi≤100-100\le x,x_i\le100; 1≤y,yi≤1001\le y,y_i\le100 for 1≤i≤N1\le i\le N; 1≤c<v≤101\le c<v\le10. All input values are integers; the polygon is simple, its vertices are counterclockwise, its boundary neither crosses nor touches itself, and PP is strictly inside. N=4N=4 and all edges are axis-aligned (a rectangle).
  • Subtask 2 (30 points): 3≤N≤303\le N\le30; −100≤x,xi≤100-100\le x,x_i\le100; 1≤y,yi≤1001\le y,y_i\le100 for 1≤i≤N1\le i\le N; 1≤c<v≤101\le c<v\le10. All input values are integers; the polygon is simple, its vertices are counterclockwise, its boundary neither crosses nor touches itself, and PP is strictly inside. The polygon is convex (consecutive collinear vertices are allowed).
  • Subtask 3 (50 points): 3≤N≤303\le N\le30; −100≤x,xi≤100-100\le x,x_i\le100; 1≤y,yi≤1001\le y,y_i\le100 for 1≤i≤N1\le i\le N; 1≤c<v≤101\le c<v\le10. All input values are integers; the polygon is simple, its vertices are counterclockwise, its boundary neither crosses nor touches itself, and PP is strictly inside.

Examples

Input

4 0 50 2 1
-1 10
1 10
1 90
-1 90

Output

25.8660

Explanation

The target lies between two vertical sides, each 1 m away. Entry on either side at height about 49.42265 m takes 24.71132 min; the remaining distance is about 1.15470 m, taking 1.15470 min. The minimum is 25.866025... min, rounded to 25.8660.

Input

4 0 2 2 1
-10 1
10 1
10 5
-10 5

Output

1.5000

Explanation

The bottom reaches the liquid after 0.5 min; the target is 1 m above it, requiring one more minute. Every other side is at least 3 m away and cannot reach the target sooner.