#P3194. Visible Lines in the Upper Envelope
Visible Lines in the Upper Envelope
Visible Lines in the Upper Envelope
In an coordinate plane, you are given lines , each defined in the form (with ) and no two lines are identical. When looking downward from , if some segment of line is visible (i.e. it appears on the upper envelope of all lines), then is considered visible; otherwise, it is covered. For example, for the lines
- $L_1: y=x$
- $L_2: y=-x$
- $L_3: y=0$
and are visible, while is covered.
Your task is to determine all visible lines. Output the indices of the visible lines (1-indexed) in increasing order. A line is visible if and only if there exists at least one for which its value is strictly maximum among all given lines.
inputFormat
The first line of input contains an integer () representing the number of lines. Each of the following lines contains two integers and , representing a line . It is guaranteed that no two lines are identical.
outputFormat
Output a single line containing the indices of all visible lines in increasing order, separated by a space.
sample
3
1 0
-1 0
0 0
1 2