Biathlon
Biathlon
Piggy decided to organize a biathlon race, where the competitors would compete in two disciplines. She invited n competitors, who have the following characteristics:
Each competitor has velocities
v1
andv2
, for the two disciplines, respectively.The competitors have constant velocities (
v1
andv2
) throughout the respective tracks.The distance, which a competitor covers for time
t1
in the first discipline iss1
=v1t1
, and the distance for the second discipline for timet2
iss2
=v2t2
.A competitor wins, if the sum of his times is uniquely the smallest among these of all competitors (i.e. strictly less than all the others).
As an organizer, Piggy can choose whatever distances she likes (non-negative real numbers s1
and s2
) for each of the two disciplines. Now she is wondering which competitors are potential winners, that’s to say, whether there exist s1
and s2
to ensure them victory.
Write a program to determine which competitors can win.
Input
On the first line n (2 ≤ n ≤ 105
) is given. On the next n lines are given two positive integers v1
and v2
(1 ≤ v1
, v2
≤ 104
): the velocities of the i-th competitor (for i = 0, 1, ..., n - 1).
Output
On one line print the indexes of the competitors who can win. The indexes should be in increasing order, separated by spaces. Indexing starts from 0. This line should contain the number -1, when there is no competitor who can win.
Explanation
First example. All competitors, who can win, have the indexes: 0, 2 and 3. The one with index 0 wins for distances, for example, s1
= 0 and s2
= 10; competitor with index 2 wins for distances s1
= 10 and s2
= 0; the one with index 3 wins for some distances s1
= 10 and s2
= 10. Competitor with index 1 cannot win: he is always being defeated by competitor with index 3.
Second example. Only competitors 0 and 1 can have minimal times, but neither of them unique. That's why the correct output is -1.
4 1 4 2 2 4 1 3 3
0 2 3
3 3 3 3 3 2 2
-1