037. Practice Katanas

Codeforces
IDCF10269037
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You've just bought a set of practice katanas, which have an item number of 1101-1816. While staring at this item number, you wonder what the LCM (Least Common Multiple) of 1101 and 1816 is. To calculate the LCM of two numbers, you can multiply the two numbers together, and divide this result by the GCD (Greatest Common Divisor) of the two numbers. For example, let's take the numbers 60 and 72. Their GCD is 12 (12 is the greatest number that divides both numbers), their product (60 x 72) is 4320, and their GCD is 4320 / 12 = 360. To calculate the GCD of two numbers, you can use this recursive formula: gcd(a, b) = a, if b = 0 otherwise, gcd(a, b) = gcd(b, a mod b) The only line of input contains two positive integers $a$ and $b$. Output a single positive integer $n$: the LCM (Least Common Multiple) of $a$ and $b$. ## Input The only line of input contains two positive integers $a$ and $b$. ## Output Output a single positive integer $n$: the LCM (Least Common Multiple) of $a$ and $b$. [samples]
**Definitions** Let $ a, b \in \mathbb{Z}^+ $ be two positive integers. **Constraints** $ a, b \geq 1 $ **Objective** Compute the least common multiple: $$ \text{lcm}(a, b) = \frac{a \cdot b}{\gcd(a, b)} $$ where $ \gcd(a, b) $ is defined recursively by: $$ \gcd(a, b) = \begin{cases} a & \text{if } b = 0 \\ \gcd(b, a \bmod b) & \text{otherwise} \end{cases} $$
API Response (JSON)
{
  "problem": {
    "name": "037. Practice Katanas",
    "description": {
      "content": "You've just bought a set of practice katanas, which have an item number of 1101-1816. While staring at this item number, you wonder what the LCM (Least Common Multiple) of 1101 and 1816 is. To calcul",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269037"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You've just bought a set of practice katanas, which have an item number of 1101-1816. While staring at this item number, you wonder what the LCM (Least Common Multiple) of 1101 and 1816 is.\n\nTo calcul...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ a, b \\in \\mathbb{Z}^+ $ be two positive integers.\n\n**Constraints**  \n$ a, b \\geq 1 $\n\n**Objective**  \nCompute the least common multiple:  \n$$\n\\text{lcm}(a, b) = \\frac{a \\cdot b...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments