- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
Today is the Flower Festival day. The festival is held in Rose Square, at the end of Flower Street. People are heading towards the festival on Flower Street with n cars, numbered $1$ through $n$. Soroush, an expert traffic analyst, wants to know which car will arrive at Rose Square first. Using the traffic cameras on Flower Street, he has gathered the current location of all cars, along with their speeds. Each car maintains a constant speed throughout their journey. Also, the location of a car is defined as its distance from the start of Flower Street. Help Soroush find the first car that arrives at the festival. It is guaranteed that no two cars reach Rose Square at the same time.
ورودی
The first line of input contains two space-separated integers $n$ ($1 \leq n \leq 100$) and $f$ ($1 \leq f \leq 10,000$), the number of cars and the length of Flower Street, respectively. The $(i + 1)-th$ line (for $1 \leq i \leq n$) contains the information of car numbered $i$, two space-separated integers $x_i$ ($0 \leq x_i < f$) and $v_i$ ($1 \leq v_i \leq 100$) indicating its observed location and speed, respectively.
خروجی
Print the number of the car which will arrive at Rose Square first.
مثالها
ورودی نمونه ۱
3 200
0 1
10 5
40 1
خروجی نمونه ۱
2
ورودی نمونه ۲
5 100
0 1
10 3
60 2
75 1
10 4
خروجی نمونه ۲
3
ارسال پاسخ برای این سؤال