#P1663. 山

Description

Given a mountain as shown in the figure.

You need to place a lamp somewhere on the mountain so that every part of the mountain is visible.

Output the minimum yy-coordinate. As shown, the + mark indicates the installation point with the minimum yy-coordinate.

Input Format

The first line contains an integer NN, indicating that the mountain consists of NN points.

The next NN lines, from left to right, describe the mountain. Each line contains two numbers Xi,YiX_i, Y_i representing a vertex, and it is guaranteed that Xi>Xi1X_i > X_{i-1}.

Output Format

Output a single line with the minimum yy-coordinate. Your answer is considered correct if it differs from the standard answer by no more than 0.010.01.

6
0 0
10 0
11 1
15 1
16 0
25 0
3.00

Hint

Constraints:

30%30 \% of the testdata, 1N501 \le N \le 50.

100%100 \% of the testdata, 1N50001 \le N \le 5000; 0Xi,Yi1000000 \le X_i, Y_i \le 100000, and the answer is guaranteed to be no more than 10000001000000.

Translated by ChatGPT 5