#P9569. 「NnOI R2-T1」Khronostasis Katharsis
「NnOI R2-T1」Khronostasis Katharsis
Problem Description
There are balloons tied to a flat ground. Their initial height is meters, and the initial time is the -th second.
After the rope of a balloon is cut, it will rise at a constant speed. The -th balloon rises meters per second.
Now it is known that the rope of the -th balloon will be cut at the -th second. Find the index of the balloon with the greatest height at the -th second; if there are multiple, output the smallest index among them.
Input Format
The first line contains two integers .
The next lines: the -th line contains two integers .
Output Format
Output one integer in one line, representing the answer.
5 10
1 1
2 3
3 7
5 4
3 3
4
20 131
872 127
228 17
273 66
306 78
636 107
878 110
1141 122
835 10
247 28
248 48
65 4
664 109
267 96
1103 87
725 83
231 119
671 58
825 52
391 47
573 100
8
Hint
[Sample 1 Explanation]
At the -th second, the heights of the five balloons are meters, respectively.
[Constraints]
For of the testdata, it is guaranteed that , and .
Hint: This problem enables bundled tests.
$$\def\r{\cr\hline} \def\None{\text{None}} \def\arraystretch{1.5} \begin{array}{c|c|c} \textbf{Subtask} & \textbf{Sp. Constraints} & \textbf{Score}\r \textsf1& n \le 1000 & 33 \r \textsf2& v_i\ 相等 & 10 \r \textsf3& t_i \ 相等 & 10 \r \textsf4& 无特殊限制 & 47 \r \end{array}$$Source
| Item | Person |
|---|---|
| idea | EstasTonne |
| data | |
| check | Chuanjiang Mowang |
| solution | EstasTonne |
Translated by ChatGPT 5