Garland
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The garland consists of N bulbs for general wire. One end is fixed at a given height A mm (H_1 = A). Due to the gravity bends garland: the height of each non lamp at 1 mm less than the average height of the nearest-neighbor (H_i = (H_i_{ - 1} + H_i_{ + 1})/2 - 1 for 1 < i < N). Required to find the minimum height of the second end B (B = H_N) provided that none of the bulbs should not lie on the ground (H_i > 0 for 1 ≤ i ≤ N).
Input
The first line contains two numbers, N and A. 3 ≤ N ≤ 1000 - integer, 10 ≤ A ≤ 1000 - real.
Output
Print a single real number B with the two characters after the decimal point.
Examples
Input #1
Answer #1
Submissions 129
Acceptance rate 49%