The least common multiple is the smallest positive number divisible by both a and b. It's tied to the GCD:
lcm(a, b) = a / gcd(a, b) × b
Divide before multiplying. a × b can overflow even when the LCM itself fits.
Reusing a function you already trust, here gcd, is a core logic-building skill. Big problems are just small solved problems put together.