import math.{ pow, sqrt }

object Main extends App {
  val src = io.Source.stdin.getLines.map(_.toDouble).grouped(2).map { case List(a, b) => (a, b) }

  for ((x, h) <- src if x != 0) println(sqrt(pow(x/2, 2) + pow(h, 2))*x*2 + x*x)
}

