module Main where

import           Data.List

toInt :: String -> Int
toInt s = read s :: Int

strToIntList :: String -> [Int]
strToIntList = map toInt . words

main :: IO ()
main = do
  l1 <- getLine
  l2 <- getLine
  let (_ : k : _) = strToIntList l1
  let ps          = strToIntList l2
  print $ diceExs k ps

-- | hoge
-- >>> diceExs 3 [1, 2, 2, 4, 5]
-- 7.0
-- >>> diceExs 1 [6, 6, 6, 6]
-- 3.5
-- >>> diceExs 4 [17,13,13,12,15,20,10,13,17,11]
-- 32.0
diceExs :: Int -> [Int] -> Double
diceExs n l =
  maximum [ sum $ map exs x | x <- filter ((<=) n . length) $ acc (take n) l ]

acc f []       = []
acc f (x : xs) = f (x : xs) : acc f xs

exs :: Int -> Double
exs n = (fromIntegral n + 1) / 2.0
