| UTPC Contest 09-08-23 Div. 1 |
|---|
| Finished |
Scientists Mike and Harvey have collected some iguanas from the nearby Amazon rainforest. They are interested in two specific traits of each iguana: the number of scales and the number of colors they can camouflage into.
After spending several weeks researching, Mike and Harvey believe that the best iguanas have more scales and fewer colors. More specifically, an iguana $$$i$$$ is "better" than iguana $$$j$$$ if the ratio of $$$i$$$'s scales to $$$j$$$'s scales is greater than the ratio of $$$i$$$'s colors to $$$j$$$'s colors. If these ratios are equal, the iguana with the higher ID is considered better.
Currently, they have given $$$N$$$ iguanas IDs from $$$1$$$ through $$$N$$$ $$$(3 \leq N \leq 10^5)$$$. Each iguana has some number of scales, denoted $$$a_i$$$ $$$(1 \leq i \leq N$$$, $$$1 \leq a_i \leq 10^9)$$$, and some number of colors, denoted $$$b_i$$$ $$$(1 \leq i \leq N$$$, $$$1 \leq b_i \leq 10^9)$$$. Please help Mike and Harvey figure out what the three "best" iguanas are.
The first line of input contains a single integer, $$$N$$$. The second line contains $$$N$$$ integers: $$$a_1, a_2, … a_N$$$ The third line contains $$$N$$$ integers, $$$b_1, b_2, … b_N$$$
Please output three lines, containing the IDs of the first, second, and third-best iguanas, respectively.
6 1 3 10 5 6 9 7 8 2 4 6 9
3 4 6
| Name |
|---|


