Run and Swim Race
Time limit2sMemory limit512 MB
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.
Problem
An algorithm camp holds a two event race. The race has a running leg and a swimming leg. Every participant runs meters first, then swims 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 participants. Participant runs at meters per second and swims at meters per second, so participant reaches the finish line at time seconds.
Seonggwan knows both speeds of every participant, but he does not know and . He only knows that and are real numbers greater than 0. The winner changes with the choice of and , so he wants to know who can win. Participant can win if there are real numbers and that make participant 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 . ()
Each of the next lines describes one participant. Line contains the swimming speed and then the running speed of participant . Note that the swimming speed comes first. Both values are positive integers. ()
Output
Print the numbers of all participants who can win, in increasing order, on one line. Separate the numbers with a single space.