Gears
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Consider two interconnected gears. One gear has N teeth, and the other has K teeth.
Your task is to determine the minimum number of rotations per tooth needed for both gears to return to their starting positions.
Input
The input consists of a single line containing two integers, N and K (1 ≤ N, K ≤ 10^7).
Output
Output the minimum number of teeth rotations required. It is guaranteed that this number will not exceed 10^9.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 53%