import Data.Complex import Data.List main :: IO () main = mapM_ (print . f) $ 999 : 1000 : 20 : [1 .. 6] f :: Int -> Double f n = (!! n) $ nub $ sort [magnitude $ x :+ y | x <- a, y <- a] where a = map fromIntegral [0..ceiling $ sqrt $ fromIntegral $ 4 * n]