Races#2349

Races

1 second
64 megabytes
Easy

Fred and George have created an exciting new game. They construct stairs using thick books and mark a finish line at a certain distance away. Players take turns placing their cars on a launch ramp. The cars accelerate due to gravity, leap over the steps, and eventually come to a stop due to the force of friction. The winner is the player whose car stops closest to the finish line.

Write a program that determines the exact location where the car should be placed so that it stops exactly on the finish line. Assume the gravitational acceleration is m/s^2. Friction applies an acceleration of m/s^2 on both the launch ramp and the horizontal sections of the path. The vertical component of velocity is entirely dissipated after the launch ramp or any jump (kinetic energy is converted into internal energy). Consider the size of the car as a point. The launch ramp is inclined at 45^\circ.

Input

The first line of the input file contains two integers separated by a space: the number of steps on the stairs (1 \leq N \leq 10) and the distance from the bottom step to the finish line (10 \leq R \leq 200). The next lines each contain two integers separated by a space: the length of the step L_i (5 \leq L_i \leq 25) and the height of the step H_i (1 \leq H_i \leq 10). Steps are described starting from the top. All distances and heights are given in centimeters.

Output

Output a single number with decimal places: the distance in centimeters from the lower edge of the launch ramp to the position where the car should be placed. If there are several possible positions, output the smallest distance.

Examples

Example 1

Loading
Loading