-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path492B.hs
More file actions
32 lines (26 loc) · 717 Bytes
/
492B.hs
File metadata and controls
32 lines (26 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Data.List
import System.IO
readInput :: Read a => IO [a]
readInput = fmap (map read . words) getLine
getNLine :: Int -> IO [String]
getNLine n
| n <= 0 = return []
| otherwise = do
x <- getLine
xs <- getNLine $ n-1
let ret = (x:xs)
return ret
main :: IO ()
main = do
n <- readInput :: IO [Int]
l <- readInput :: IO [Int]
let xs = reverse (last n : reverse (0 : sort l))
let dis = zipWith (-) (tail xs) xs
-- print dis
print $ solve dis
-- putStrLn xs
solve :: [Int] -> Double
solve li = max max_dis end_point
where
max_dis = fromIntegral (maximum li) / 2
end_point = fromIntegral (max (head li) (last li))