{"problem":{"name":"124. Tour De France","description":{"content":"You attended the final stage of the Tour De France, and after the event has ended, you want to know the final results. However, all you know is how long it took each biker to reach your position, and ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269124"},"statements":[{"statement_type":"Markdown","content":"You attended the final stage of the Tour De France, and after the event has ended, you want to know the final results. However, all you know is how long it took each biker to reach your position, and how fast they were traveling when they passed you. \n\nGiven your constant position during the race, the position of the finish line, and the information described above, you must figure out the final standings of the race. You can assume that after each biker passed you, they maintained a constant speed.\n\nThe first line of input contains three space-separated integers $n$, $m$, and $k$, representing the number of bikers in the race, your position, in miles, and the position of the finish line, in miles, respectively. The next $n$ lines each contain a string representing each biker's name, and a space, followed by two space-separated decimal numbers, representing the time that the biker passed by you, in seconds, and the biker's speed, in miles per hour, respectively.\n\nOutput $n$ integers: each biker's name, sorted by their overall place in the race. The biker that finished first should be first in the list, and the biker that finished last should be last in the list.\n\nThis problem was originally made for the contest where all of the problems were based on Kraftwerk songs. It was removed from the contest beforehand for various reasons.\n\n## Input\n\nThe first line of input contains three space-separated integers $n$, $m$, and $k$, representing the number of bikers in the race, your position, in miles, and the position of the finish line, in miles, respectively. The next $n$ lines each contain a string representing each biker's name, and a space, followed by two space-separated decimal numbers, representing the time that the biker passed by you, in seconds, and the biker's speed, in miles per hour, respectively.\n\n## Output\n\nOutput $n$ integers: each biker's name, sorted by their overall place in the race. The biker that finished first should be first in the list, and the biker that finished last should be last in the list.\n\n[samples]\n\n## Note\n\nThis problem was originally made for the contest where all of the problems were based on Kraftwerk songs. It was removed from the contest beforehand for various reasons.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of bikers.  \nLet $ m \\in \\mathbb{R}^+ $ be your position (in miles).  \nLet $ k \\in \\mathbb{R}^+ $ be the finish line position (in miles).  \nFor each biker $ i \\in \\{1, \\dots, n\\} $:  \n- Let $ s_i \\in \\mathbb{R}^+ $ be their speed (in miles per hour).  \n- Let $ t_i \\in \\mathbb{R}^+ $ be the time (in seconds) when they passed you.  \n\n**Constraints**  \n1. $ 1 \\le n \\le 10^5 $ (implied by contest context)  \n2. $ 0 < m < k $  \n3. $ t_i > 0 $, $ s_i > 0 $ for all $ i $  \n\n**Objective**  \nFor each biker $ i $, compute their total race time $ T_i $ (in seconds) from start to finish:  \n$$\nT_i = t_i + \\frac{(k - m)}{s_i} \\cdot 3600\n$$  \nSort the bikers by ascending $ T_i $, and output their names in that order.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269124","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}