406547: GYM102439 A Four minutes until BSUIR Open

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Four minutes until BSUIR Opentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Recently, Yura bought a new car. Let's uncover some of its features: the car can speed up with acceleration no more than $$$a$$$, maintain a constant speed and also brake with deceleration no more than $$$b$$$. But the main thing is the car doesn't have a maximum speed, so it can go faster than the speed of light and move its owner to the future.

Yura enjoyed his car that much that he forgot, that BSUIR Open starts in $$$4$$$ minutes. Yura's house and the university are located in a straight line. Unfortunately, it is not possible to reach the speed of light, cause the whole path from home to the university is covered with speed cameras. Specifically, the path has $$$n$$$ cameras, $$$i$$$-th located at point $$$x = x_i$$$ denoting that at this point the car should move with speed no more than $$$v_i$$$ or its owner will get a fine.

The house is located at point $$$x = 0$$$, and the university — at the same point where the last camera ($$$x = x_n$$$). Calculate the minimum time to get to the university from home by car. Note that Yura starts at zero speed.

Input

The first line contains three integers $$$n, a, b$$$ — denoting the number of speed cameras on the path and the car parameters.

Each line $$$i$$$ of the following $$$n$$$ subsequent lines contains two integers $$$x_i, v_i$$$. It is guaranteed, that $$$x_i > x_{i - 1}$$$ for all $$$i > 1$$$.

$$$$$$1 \le n \le 10^5, 1 \le a, b \le 1000$$$$$$ $$$$$$1 \le x_i \le 10^7, 0 \le v_i \le 1000$$$$$$

Output

Print a single number — minimal time to reach the university from home without fines. Your answer would be considered correct, if absolute or relative error won't exceed $$$10^{-6}$$$.

ExamplesInput
2 1 1
1 1
2 2
Output
2.1815405
Input
4 1 5
2 3
4 5
7 3
9 5
Output
4.3598594

加入题单

上一题 下一题 算法标签: