본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 28225번 Flower Festival

by 현장 2024. 12. 28.

-Code

n, f = map(int, input().split())
now_time, res = 1e9, 0

for i in range(n):
    x, v = map(int, input().split())
    time = (f - x) / v
    if now_time > time:
        now_time = time
        res = i + 1

print(res)