|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||14||3||3||25.000%|
The organizers of CEOI 2011 are planning to hold a party with lots of balloons. There will be n balloons, all sphere-shaped and lying in a line on the floor.
The balloons are yet to be inflated, and each of them initially has zero radius. Additionally, the i-th balloon is permanently attached to the floor at coordinate xi. They are going to be inflated sequentially, from left to right. When a balloon is inflated, its radius is increased continuously until it reaches the upper bound for the balloon, ri, or the balloon touches one of the previously inflated balloons.
Figure 1: The balloons from the example test, after being fully inflated.
The organizers would like to estimate how much air will be needed to inflate all the balloons. You are to find the final radius for each balloon.
The first line of the standard input contains one integer n (1 ≤ n ≤ 200 000) — the number of balloons. The next n lines describe the balloons. The i-th of these lines contains two integers xi and ri (0 ≤ xi ≤ 109, 1 ≤ ri ≤ 109). You may assume that the balloons are given in a strictly increasing order of the x coordinate.
Your program should output exactly n lines, with the i-th line containing exactly one number — the radius of the i-th balloon after inflating. Your answer will be accepted if it differs from the correct one by no more than 0.001 for each number in the output.
3 0 9 8 1 13 7
9.000 1.000 4.694