Least Common Multiple
Easyjavapythonccppjavascript
Given two positive integers, find their least common multiple (LCM) — the smallest positive integer divisible by both.
Input Format
A single line containing two integers A and B.
Output Format
Print the LCM of A and B.
Example 1
Input
12 18
Output
36
Explanation: 36 is divisible by both 12 and 18, and no smaller positive common multiple exists.
- 1 <= A, B <= 1000000