main = culcSurfaceArea
culcSurfaceArea = do
        x <- readLn
        h <- readLn
        if x == 0 && h == 0 then return ()
                            else do
                                print $ surfaceArea x h
                                culcSurfaceArea
surfaceArea x h = x^2 + 2 * x * h'
    where h' = sqrt $ (x/2)^2 + h^2