import Data.List
import Data.Function

divvy :: Int -> [Int] -> [[Int]]
divvy k = go
  where
    go :: [Int] -> [[Int]]
    go [] = []
    go as@(p:ps) = take k as : go ps

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

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