func gcd(_ a: Int, _ b: Int) -> Int { if b == 0 { return a } else { if a > b { return gcd(a-b, b) } else { return gcd(a, b-a) } } }
func gcd(_ m: Int, _ n: Int) -> Int { var a = 0 var b = max(m, n) var r = min(m, n) while r != 0 { a = b b = r r = a % b } return b }
func gcd(_ a: Int, _ b: Int) -> Int { let r = a % b if r != 0 { return gcd(b, r) } else { return b } }
func lcm(_ m: Int, _ n: Int) -> Int { return m*n / gcd(m, n) }