047. Who will win

Codeforces
IDCF10269047
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Two runners are racing against each other in the 400 meter dash and you want to know who will win. The current distance covered by each runner(meters) and the speed (meters per second) will be given for each runner. Return whether the first or the second runner will end up winning the race assuming they travel at the speed throughout the remainder of the race. The first line will contain a sentence describing the first runner and the second will describe the second. The following format will be used: "runner X is traveling at Y meters per second and has already covered Z meters" Print which runner will win the race in the following format: "Runner X wins" ## Input The first line will contain a sentence describing the first runner and the second will describe the second. The following format will be used: "runner X is traveling at Y meters per second and has already covered Z meters" ## Output Print which runner will win the race in the following format: "Runner X wins" [samples]
**Definitions** Let $ d_1, v_1 \in \mathbb{R}^+ $ be the distance covered and speed of Runner 1, respectively. Let $ d_2, v_2 \in \mathbb{R}^+ $ be the distance covered and speed of Runner 2, respectively. **Constraints** The race distance is $ 400 $ meters. $ 0 \leq d_1 < 400 $, $ 0 \leq d_2 < 400 $, $ v_1 > 0 $, $ v_2 > 0 $. **Objective** Compute the remaining time for each runner to finish: $$ t_1 = \frac{400 - d_1}{v_1}, \quad t_2 = \frac{400 - d_2}{v_2} $$ Determine the winner: - If $ t_1 < t_2 $, Runner 1 wins. - If $ t_2 < t_1 $, Runner 2 wins. - If $ t_1 = t_2 $, tie (but problem implies distinct winner). Output: "Runner 1 wins" if $ t_1 < t_2 $, otherwise "Runner 2 wins".
API Response (JSON)
{
  "problem": {
    "name": "047. Who will win",
    "description": {
      "content": "Two runners are racing against each other in the 400 meter dash and you want to know who will win. The current distance covered by each runner(meters) and the speed (meters per second) will be given f",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269047"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Two runners are racing against each other in the 400 meter dash and you want to know who will win. The current distance covered by each runner(meters) and the speed (meters per second) will be given f...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ d_1, v_1 \\in \\mathbb{R}^+ $ be the distance covered and speed of Runner 1, respectively.  \nLet $ d_2, v_2 \\in \\mathbb{R}^+ $ be the distance covered and speed of Runner 2, resp...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments