You are at a traffic light in your car, and beside or across from you is someone just like you. You don't know them, but you both sense what's about to happen. Without honking or revving your engines, you both understand: it's time to see whose car is faster. At the signal, with the screech of tires and the roar of exhaust, you both take off. Among all the cars at the light, only you two race. If one of them is you, then you're a true street racer.
Local racers often gather on an unfinished runway outside the city. The meeting point is the fork before the airport, where you turn left and drive for about five minutes. Then, a right turn onto the spare strip, and you're there. Races are held both day and night.
One night, traffic police officers set up speed limit signs along the track. The next race had to comply with the speed limits. Remember, a speed limit sign requires you to not exceed the indicated speed. The sign's effect starts at its location and ends at the next sign. From the track's start to the first sign, the usual limit is km/h.
If your car's engine can provide a maximum acceleration of a_1 m/s^2 and a maximum braking deceleration of a_2 m/s^2, what is the minimum possible time to complete the track? At the start, your car is stationary.
The first line contains a real number — the length of the track (0 < S \leq 10000 m).
The second line contains two real numbers a_1 and a_2 (0 < a_1, a_2 \leq 10 m/s^2).
The third line contains an integer — the number of speed limit signs (0 \leq N \leq 100).
Each of the next lines contains two real numbers S_i and V_i separated by a space — the distance from the start of the track to the -th sign (1 \leq i \leq N) and the speed limit in km/h on that sign (0 \leq S_i < S, 0 < V_i \leq 500). The signs are given in order of their positions from the start (S_i < S_{i+1} for 1 \leq i < N).
The output should be a single real number — the minimum time in seconds, with six decimal places.
Example 1