Functions
Function-29
Function-30
Function-31
~/algor $ cat problems/funksiya-ekuk
LCM of two numbers
Easy
1000 ms
128 MB
28%
Write a function Lcm(a, b) that returns the least common multiple (LCM) of the positive integers $a$ and $b$, that is the smallest positive integer divisible by both $a$ and $b$.
Example 1: Lcm(4, 6) → 12
Example 2: Lcm(7, 5) → 35
Write only the function body.
Input
One line with two positive integers $a$ and $b$ — the arguments of the function.
Output
The value returned by the function: an integer.
Note
$1 \le a, b \le 10^{6}$
Examples
Input #1
4 6
Output #1
12
Input #2
7 5
Output #2
35