Problems > Least Common Multiple

Least Common Multiple

Difficulty: 900 2000 ms 128 MB

math

Print the least common multiple of A and B.

Input: one line with two integers A and B.

Output: lcm(A, B) = A / gcd(A, B) · B.

Constraints:

  • 1 ≤ A, B ≤ 109

Sample Tests

Input 1
4 6
Output 1
12
Input 2
7 13
Output 2
91

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.