import scala.io.StdIn.readDouble

object Main extends App {
  var x = 0D;var h = 0D
  while( {x=readDouble;x} != 0D && {h=readDouble;h} != 0D ) {
    val hh = Math.sqrt(h*h+x*x/4)
    println(x*x+2*x*hh)
  }
}