LCM

Report a typo

Whoa! This problem is much more complex than the usual one: you need to know what the least common multiple is. If you're feeling up to the challenge, brace yourself and good luck! Otherwise, you can skip it for now and return any time later

The least common multiple (LCM) of two integers is the smallest positive number that is divisible by both of them.

Write a program that reads two large positive integers and calculates the LCM.

Tip: LCM(a,b)=abGCD(a,b)LCM(a,b) = \frac{a \cdot b}{GCD(a,b)}

Sample Input 1:

6
8

Sample Output 1:

24
Write a program in Kotlin
fun main() {
// write your code here
}
___

Create a free account to access the full topic