lcm(a, b) = a * b / gcd(a, b) lcm(a, b, c) = lcm(lcm(a, b), c)
In STL, there is a built-in std::lcm
std::lcm
Last updated 1 year ago