package yukicoder object Main { def main(args: Array[String]): Unit = { val n = io.StdIn.readLine().toInt val xys = (for (i <- 1 to n) yield io.StdIn.readLine().split(' ').map(_.toInt)).toList val gs = genCommutativeGroup(xys) val ans = n match { case 0 => 1.0 case _ => { Math.sqrt(gs.map(maxDistance).max) + 2.0 } } println(ans) } def distance2(p1: Array[Int], p2: Array[Int]): Double = Math.pow(p1(0) - p2(0), 2) + Math.pow(p1(1) - p2(1), 2) def commutable(p1: Array[Int], p2: Array[Int]): Boolean = { distance2(p1, p2) <= 100 } def commutableGroup(xys: List[Array[Int]] , p1: Array[Int]): List[Array[Int]] = { if(xys.isEmpty) Nil else { val g = xys.filter(p2 => commutable(p1, p2)) val next = xys.diff(g) g ++ g.flatMap(commutableGroup(next, _)) } } def genCommutativeGroup(ps: List[Array[Int]]): List[List[Array[Int]]] = { ps match { case h :: t => { val g = commutableGroup(ps, h) g :: genCommutativeGroup(t.diff(g)) } case _ => Nil } } def maxDistance(g: List[Array[Int]]): Double = { (for (i <- g; j <- g) yield distance2(i, j)).max } }