| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 0.3 초 | 1024 MB | 22 | 13 | 6 | 50.000% |
Valter is a fan of experiments. His latest experiment is depicted in the figure: he rolls several pipes down an inclined floor until they are stopped either by the wall perpendicular to the floor or by another pipe rolled earlier; after all the pipes have stopped, Valter measures the distance from the wall to the farthest point of the farthest pipe.
Now his classmate Vanessa pointed out that some pipes may have no impact on the result. For example, in the figure, neither pipe 1 nor pipe 3 impact the positions of the following pipes. In addition, the farthest point may be in a pipe that was not rolled last.
Write a program that gets the radii of the pipes and computes the distance from the wall to the farthest point among all the pipes.
The first line contains $N$ (1ドル \le N \le 10^5$), the number of pipes. Each of the following $N$ lines contains one real number, the radii $R_i$ (0ドル < R_i \le 10^9$) of the pipes, in the order in which the pipes are rolled. Each radius is given with at most two digits after the decimal point.
Output a single real number: the distance from the wall to the farthest point among all the pipes. The answer $x$ will be accepted if $\frac{|x-x'|}{1+x'} < 10^{-6},ドル where $x'$ is the jury's answer.
7 1 10 1 3 1 5 1
34.362825
2 3324.31 3324.32
13297.26
3 4.00 1 4.0
16