#P4697. [CEOI 2011] Balloons

[CEOI 2011] Balloons

Description

There are nn balloons, and they are all empty at the beginning.

Next, they will be inflated one by one in order from 11 to nn. The ii-th balloon touches the ground at position xix_i.

A balloon stops inflating when it touches some previous balloon, or when it reaches its maximum radius limit. The maximum radius limit of the ii-th balloon is rir_i.

Now, please find the final radius of each balloon.

Input Format

The first line contains a positive integer nn, which represents the number of balloons.

The next nn lines each contain two integers xi,rix_i, r_i separated by a space.

Output Format

Output nn lines. Each line contains a floating-point number. The floating-point number on the ii-th line represents the final radius of the ii-th balloon.

Your answer will be judged correct if and only if the absolute error from the correct answer does not exceed 10310^{-3}.

3
0 9
8 1
13 7
9.000
1.000
4.694

Hint

For 100%100\% of the testdata, it is guaranteed that 1n2000001 \le n \le 200\,000, 0xi1090 \le x_i \le 10^9, 1ri1091 \le r_i \le 10^9, and x1<x2<<xnx_1 < x_2 < \cdots < x_n.

Translated by ChatGPT 5