406547: GYM102439 A Four minutes until BSUIR Open
Description
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.
InputThe 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$$$$$$
OutputPrint 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}$$$.
ExamplesInput2 1 1 1 1 2 2Output
2.1815405Input
4 1 5 2 3 4 5 7 3 9 5Output
4.3598594