Least common multiple of a and b.
a
b
static int lcm(int a, int b) { if (a == 0 || b == 0) return 0; return (a.abs() ~/ gcd(a, b)) * b.abs(); }