module Main where import Control.Monad (replicateM) main :: IO () main = do t <- readLn xss <- replicateM t getDoubleList mapM_ (print . solve) xss solve :: [[Double]] -> Double solve = calc . foldr step [0.0, 0.0] . filter isPosiAll where step a b = let x1 = head a x2 = head b in if x1 > x2 then a else b calc :: [Double] -> Double calc xy | y <= 0.0 = 0.0 | otherwise = atan(y / x) * 180 / pi where (x : y : _) = xy isPosiAll :: [Double] -> Bool isPosiAll = all (>= -0.00000000001) getDoubleList :: IO [[Double]] getDoubleList = map (map read . words) . tail <$> replicateM 7 getLine