Parachute

Given fall speed, parachute glide speed, a walk speed, and cars parked at integer x positions, find the minimum time to reach the safe zone at x = Xe.

Medium6MathImplementationGreedyBrute forceNo attempts yetTime limit1sMemory limit512 MB

Problem

Gyuhwan started playing a battle royale game. A hundred players compete to survive on one two dimensional map that spans from (0,0)(0, 0) to (Sy,N)(S_y, N). Coordinates are written in the order (y,x)(y, x). Surviving to the end means taking a safe area early.

When the game starts, Gyuhwan falls straight down from the starting point S(Sy,Sx)S(S_y, S_x) at the constant speed gg. During the free fall he cannot move left or right, and he may open the parachute at any moment he likes. Once the parachute is open he can move horizontally at a speed of at most aa, and the falling speed drops to g/2g/2. The horizontal speed is anything between 00 and aa, and accelerating takes no time. The x coordinate of the landing point must always be an integer that is at least 0.

After he lands, meaning his y coordinate becomes 0, he can walk or drive a car. His walking speed is ff, and there are MM cars. Each car has a position P(0,Xp)P(0, X_p) and a speed SpS_p. A car accelerates in no time, switching cars takes no time, and turning a car around takes no time. No two cars sit at the same position.

There are three ways to reach the safe zone E(0,Xe)E(0, X_e). He can open the parachute and fly straight there, he can land and walk, or he can land and drive a car.

For example, take g=10g = 10, a=2a = 2, f=1f = 1 and the starting point S(100,100)S(100, 100), as in the picture below. While falling, his speed along the x axis is 00 and his speed along the y axis is 1010. After 5 seconds he is at (50,100)(50, 100). If he opens the parachute there and moves right at the top speed 22, his speed along the x axis becomes 22 and his speed along the y axis becomes 55, so 10 seconds later he arrives at (0,120)(0, 120). Taking car 1, which is parked there, gives him a speed of 6060, and 1 second later he reaches the safe zone.

Example of one descent

Find the earliest time at which Gyuhwan can reach the safe zone.

Input

The first line contains the size of the map along the x axis NN, the number of cars MM, the vertical falling speed gg, the maximum horizontal speed with an open parachute aa, and the walking speed ff. NN is a natural number at most 200, MM is 0 or a natural number at most 100, gg is a natural number with 0<g10000 < g \le 1000, aa is a natural number with 0<a1000 < a \le 100, and ff is a natural number with 0<f500000 < f \le 50000.

The second line contains SyS_y and SxS_x of the starting point and the x coordinate of the safe zone XeX_e. SyS_y is a natural number with 0<Sy10000 < S_y \le 1000, SxS_x is an integer with 0SxN0 \le S_x \le N, and XeX_e is an integer with 0XeN0 \le X_e \le N.

Each of the next MM lines contains the position of one car XpX_p and its speed SpS_p. XpX_p is an integer with 0XpN0 \le X_p \le N, and SpS_p is a natural number with 0<Sp500000000 < S_p \le 50000000.

Output

Print the minimum time to reach the safe zone on one line, rounded to eight digits after the decimal point.