import Control.Applicative ((<$>)) import Control.Monad (replicateM, replicateM_) import Data.Complex (Complex(..), phase) import qualified Data.Text as T import qualified Data.Text.IO as T import qualified Data.Text.Read as T import Text.Printf (printf) toDeg :: Double -> Double toDeg = (/ pi) . (* 180) computeAngle :: [Complex Double] -> Double computeAngle = f . toDeg . (+ pi) . minimum . map phase where f x = if x > 55.0 then 0.0 else x unsafeReadDouble :: T.Text -> Double unsafeReadDouble t = case T.double t of Right x -> fst x Left e -> error e main :: IO () main = do t <- readLn replicateM_ t $ do _ <- T.getLine ps <- fmap ((\(x : y : _) -> x :+ y) . fmap unsafeReadDouble . T.words) <$> replicateM 6 T.getLine printf "%.16f\n" (computeAngle ps)