fun euclid(x: Int, y: Int) : Int {
var r: Int
var a: Int = x
var b: Int = y
while(b!=0) {
r = a % b
a = b
b = r
}
return a
}
fun main(arr: Array<String>) {
val a: Int = 155
val b: Int = 20
println(euclid(a, b))
}
ZnVuIGV1Y2xpZCh4OiBJbnQsIHk6IEludCkgOiBJbnQgewoJCiAgICB2YXIgcjogSW50CiAgICB2YXIgYTogSW50ID0geAogICAgdmFyIGI6IEludCA9IHkKICAgIAogICAgd2hpbGUoYiE9MCkgewoKICAgICAgICAgciA9IGEgJSBiCgogICAgICAgICBhID0gYgogICAgICAgICAKICAgICAgICAgYiA9IHIKICAgIH0KCiAgICByZXR1cm4gYSAgICAgCn0KCmZ1biBtYWluKGFycjogQXJyYXk8U3RyaW5nPikgewoJCgl2YWwgYTogSW50ID0gMTU1Cgl2YWwgYjogSW50ID0gMjAKCQoJcHJpbnRsbihldWNsaWQoYSwgYikpCn0=