B. Racetrack

Codeforces
IDCF10206B
Time1000ms
Memory64MB
Difficulty
English · Original
Formal · Original
Alice and Bob play different games. When Alice plays, she always wins exactly a points. When Bob plays, he always wins exactly b points. Today, after they finished playing, they noticed they had the same number of points. What is the smallest number this could be? The first line contains two integers, a and b, separated by spaces, where a is the number of points Alice wins in one game and b is the number of points Bob wins in one game. You should return the smallest possible number of points that Alice and Bob have, which should be an integer c. #cf_span(class=[tex-font-style-underline], body=[Constraints]): 1 ≤ a ≤ 10, 000 1 ≤ b ≤ 10, 000 1 ≤ c ≤ 100, 000, 000 ## Input The first line contains two integers, a and b, separated by spaces, where a is the number of points Alice wins in one game and b is the number of points Bob wins in one game. ## Output You should return the smallest possible number of points that Alice and Bob have, which should be an integer c. [samples] ## Note #cf_span(class=[tex-font-style-underline], body=[Constraints]):1 ≤ a ≤ 10, 0001 ≤ b ≤ 10, 0001 ≤ c ≤ 100, 000, 000
**Definitions** Let $ a, b \in \mathbb{Z}^+ $ denote the points Alice and Bob win per game, respectively. **Constraints** $ 1 \leq a \leq 10{,}000 $ $ 1 \leq b \leq 10{,}000 $ **Objective** Find the smallest positive integer $ c $ such that $ c $ is a common multiple of $ a $ and $ b $: $$ c = \mathrm{lcm}(a, b) $$
API Response (JSON)
{
  "problem": {
    "name": "B. Racetrack",
    "description": {
      "content": "Alice and Bob play different games. When Alice plays, she always wins exactly a points. When Bob plays, he always wins exactly b points.  Today, after they finished playing, they noticed they had the",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10206B"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Alice and Bob play different games. When Alice plays, she always wins exactly a points. When Bob plays, he always wins exactly b points. \n\nToday, after they finished playing, they noticed they had the...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ a, b \\in \\mathbb{Z}^+ $ denote the points Alice and Bob win per game, respectively.\n\n**Constraints**  \n$ 1 \\leq a \\leq 10{,}000 $  \n$ 1 \\leq b \\leq 10{,}000 $\n\n**Objective**  \n...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments