fun gcd(a: Int, b: Int): Int {
if (b == 0) {
return a
}
return gcd(b, a % b)
}
fun main() {
val a = 32
val b = 12
val result = gcd(a, b)
println("GCD($a, $b) = $result")
}
ZnVuIGdjZChhOiBJbnQsIGI6IEludCk6IEludCB7CiAgaWYgKGIgPT0gMCkgewogICAgcmV0dXJuIGEKICB9CgogIHJldHVybiBnY2QoYiwgYSAlIGIpCn0KCmZ1biBtYWluKCkgewogIHZhbCBhID0gMzIKICB2YWwgYiA9IDEyCgogIHZhbCByZXN1bHQgPSBnY2QoYSwgYikKCiAgcHJpbnRsbigiR0NEKCRhLCAkYikgPSAkcmVzdWx0IikKfQ==