object Yuki extends App{ import scala.io.StdIn.readLine def gcd(a:Int, b:Int):Int = { b match { case 0 => a case _ => gcd(b, a % b) } } def foldr[a, b](f:(a, b)=>b, list:List[a], init:b):b = { list match{ case Nil => init case h::tail => foldr(f, tail, f(h, init)) } } val n = readLine.toInt val list = for (_ <- (1 to n).toList) yield readLine.toInt println(100 / foldr(gcd, list, 0)) }