Spilja
In a cave near Mirko's village lived his ancestors thousands of years ago. Mirko came to a conclusion that he is the only one who can find the remains of this ancient civilization so he started with preparations to explore. Therefore, he bought new pants, boots, a shovel and a hammer. Just before research he realized that there was no power supply in the cave and that he has to buy some lamps. But as he spent all the money for buying an up-to-date hammer, he realized that he had money only for one lamp. As Mirko wants to choose a spot from where he can see the entire floor, help him to determine a minimum height to which he must raise a lamp in order to illuminate the entire floor of the cave.We will imagine the cave's floor as a broken line in a coordinate system consisting of N peaks t1, t2 tN and lengths which connect consecutive peaks.The floor always goes from left to right, i.e. for every i=1, ..., N-1 x-coordinate of ti is smaller than x-coordinate of ti+1.Example (possible solution for third test example)
6
0 0
10 0
11 1
15 1
16 0
25 0Output
3.006
1 1
4 2
5 0
9 2
12 3
16 4Izlaz
2.006
0 10
3 7
5 0
6 1
7 4
10 5Izlaz
3.75Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.