area :: Double -> Double -> Double
area x h = x * x + 2 * x * sqrt (halfx * halfx + h * h)
  where halfx = x / 2

main :: IO ()
main = getContents >>= f . map read . lines
  where f []       = return ()
        f [_]      = return ()
        f (0:0:_)  = return ()
        f (x:h:xs) = print (area x h) >> f xs