import Control.Applicative import Control.Monad import Text.Printf main :: IO () main = do n <- readLn solve <$> replicateM n (getLine >> replicateM 6 f) >>= mapM_ (printf "%f\n") where f = map read <$> words <$> getLine solve :: [[[Double]]] -> [Double] solve = map f where f = minimum . filter (> 0) . map ang . filter (\[x, y] -> x < 0 && y > 0) ang :: [Double] -> Double ang [x, _] = 180.0 * acos x / pi - 120.0