import scala.io.StdIn object Main { def main(args: Array[String]): Unit = { val in = StdIn.readLine().split(" ").map(_.toInt) val A = in(0) val B = in(1) println((A, B) match { case (a, b) if a == b => math.sqrt(a * a + b * b) case _ => math.sqrt(math.abs(A * A - B * B)) }) } }