import Text.Printf main = interact $ unlines . map (printf "%.9f" . bolt) . read' . tail . lines where read' [] = [] read' xs = map (map read . words) xys : read' xs' where (xys,xs') = splitAt 6 (tail xs) bolt :: [[Double]] -> Double bolt = head . filter (\d -> -1 < d && d < 51) . map (\[x,y] -> atan (y/x) * (180/pi))