Biathlon
Time limit2sMemory limit512 MB
Given each competitor's two speeds, find all indexes that can win for some choice of the two track distances.
- Level
Medium7 of 10
- Topics
- Geometry, Sorting, Greedy, Binary search
- Solved
- No attempts yet
Problem
Piggy is organizing a biathlon race with two disciplines. She invited competitors, and the race runs under these rules.
- Competitor covers the first discipline at speed and the second discipline at speed .
- Each competitor holds that speed over the whole of the matching track.
- The distance covered in time in the first discipline is , and the distance covered in time in the second discipline is .
- A competitor wins when the sum of his two times is strictly smaller than the sum of the two times of every other competitor.
As the organizer, Piggy picks the two distances and freely among the non-negative real numbers. A competitor is a potential winner when some choice of and makes him win. Find every potential winner.
Input
The first line contains the number of competitors . ()
Each of the next lines contains the two speeds and of competitor , separated by a space. (, )
Output
On one line, print the indexes of the potential winners in increasing order, separated by spaces. Indexing starts from 0. If no competitor can win, print -1 on that line.