import Data.List
import Data.Function

divvy :: Int -> Int -> [a] -> [[a]]
divvy n m xs
  | length xs < n = []
  | otherwise = let (a,b) = splitAt n xs
                 in a : divvy n m (drop m xs)

solve :: Int -> Int -> [Int] -> Double
solve n k p = sum $ map f mx
  where
    mx = maximumBy (compare `on` sum) $ divvy k 1 p
    f :: Int -> Double
    f x = let d = fromIntegral (sum [1..x]) :: Double
           in d / fromIntegral x

main :: IO ()
main = do
    [n,k] <- map read . words <$> getLine :: IO [Int]
    p <- map read . words <$> getLine :: IO [Int]
    print $ solve n k p