import Text.Printf (printf)

surf :: (Double,Double) -> Double
surf (x,h) = x**2.0+2.0*x*(h**2.0+(x/2.0)**2.0)**0.5

main :: IO ()
main = do
    s <- getContents :: IO String
    let input = filter (/=0) . map (\ x -> read x :: Int) . lines $ s
    let n = (length input) `div` 2
    let tuple i = (realToFrac(input!!(i*2)), realToFrac(input!!(i*2+1)))
    let input' = map (tuple) [0..(n-1)]
    mapM_ (\ x -> printf "%.6f\n" x) $ map surf input' 
    