The document describes finding the largest subset of winners from a set of competitors where each competitor has values for r and s. A competitor can be a winner if there exist values R and S such that the ratio R/r + S/s is minimum. It notes that a competitor cannot win if another has both lower r and s values. The analysis shows that the winners are the subset of competitors forming the lower-left convex hull when plotted as (1/r, 1/s) points. Implementation requires care with precision issues when dealing with fractions and handling duplicated competitors for the convex hull algorithm.
2. Description
? Given a set of competitors which have ?? and ?? as its value,
find the largest subset of possible winners W
? a competitor can be a winner if there exists ?, ? ¡Ê ?+
2
where ? =
?
? ?
+
?
? ?
has the minimum value in the set.
? Constraints : 1 ¡Ü ? ¡Ü 2 ¡Á 105, 1 ¡Ü ??, ?? ¡Ü 104
3. Obvious Facts
? A competitor ? cannot be a winner if another competitor ?
such that ?? < ?? ??? ?? < ?? exists.
?
?
(??, ??)
(??, ??)
4. Geometric Analysis
? ? should be the minimum for ? to be a winner
? min ? =
?
? ?
+
?
? ?
= R, S ?
1
? ?
,
1
? ?
= R, S ¡Á |
1
? ?
,
1
? ?
| ¡Á cos ?
? Boxed one is the component of
?
? ?
,
?
? ?
in dir. of ?, ?
? Therefore, suppose R, S is any unit vector in the first
quadrant and find the possible winners!