This page is still under construction.

Parts of this page are still being built. What you see may change.

Run and Swim Race

Time limit2sMemory limit512 MB

Summary
Given each runner's running and swimming speeds, find every participant who can finish first for some positive choice of the leg lengths R and S.
Level

Hard8 of 10

Topics
Geometry, Sorting, Greedy, Math
Solved
No attempts yet

Problem

An algorithm camp holds a two event race. The race has a running leg and a swimming leg. Every participant runs RR meters first, then swims SS meters. The person who reaches the finish line first wins. If several people reach the finish line at the same moment, all of them are co-winners.

Before the race starts, Seonggwan looks at the records of the NN participants. Participant ii runs at rir_i meters per second and swims at sis_i meters per second, so participant ii reaches the finish line at time Rri+Ssi\frac{R}{r_i} + \frac{S}{s_i} seconds.

Seonggwan knows both speeds of every participant, but he does not know RR and SS. He only knows that RR and SS are real numbers greater than 0. The winner changes with the choice of RR and SS, so he wants to know who can win. Participant ii can win if there are real numbers R>0R > 0 and S>0S > 0 that make participant ii a winner or a co-winner. Write a program that finds every participant who can win.

Input

The first line contains the number of participants NN. (1≤N≤2000001 \le N \le 200000)

Each of the next NN lines describes one participant. Line ii contains the swimming speed sis_i and then the running speed rir_i of participant ii. Note that the swimming speed comes first. Both values are positive integers. (1≤si,ri≤100001 \le s_i, r_i \le 10000)

Output

Print the numbers of all participants who can win, in increasing order, on one line. Separate the numbers with a single space.

Examples2

  1. Example 1

    Input
    3
    1 3
    2 2
    3 1
    
    Expected output
    1 2 3
    
  2. Example 2

    Input
    3
    1 2
    1 1
    2 1
    
    Expected output
    1 3