import Control.Applicative ((<$>)) import Control.Monad (replicateM, replicateM_) import Data.Complex (Complex(..), phase) import Data.List (sort) import Text.Printf (printf) toDeg :: Double -> Double toDeg = (/ pi) . (* 180) computeAngle :: [Complex Double] -> Double computeAngle = f . toDeg . (+ pi) . head . sort . map phase where f x = if x > 55.0 then 0.0 else x main :: IO () main = do t <- readLn replicateM_ t $ do _ <- getLine ps <- map ((\(x : y : _) -> x :+ y) . map read . words) <$> replicateM 6 getLine printf "%.16f\n" (computeAngle ps)