import Control.Monad (replicateM_) import Text.Printf (printf) newton :: Double -> Double -> Double -> Double -> Double -> Double newton a b t n d | abs d > 10e-10 = newton a b t n' d' | otherwise = n' where t1 = log n t2 = n ** (a - 1.0) t3 = t1 ** (b - 1.0) d' = (t2 * n * t3 * t1 - t) / (t2 * t3 * (a * t1 + b)) n' = n - d' solve :: Double -> Double -> Double -> Double solve a b t | a == 0.0 = exp (t ** (1.0 / b)) | b == 0.0 = t ** (1.0 / a) | otherwise = newton a b t 2.0 114514 main = do m <- readLn replicateM_ m $ do [a, b, t] <- map read . words <$> getLine printf "%.10f\n" $ solve a b t