import Data.List
import Data.Function

fnc :: Int -> [Int] -> [Int]
fnc k p = go (0,[]) p
  where
    go (_,xs) []  = xs
    go (sm,xs) as@(p:ps)
      | sm < sm'  = go (sm',xs') ps
      | otherwise = go (sm,xs) ps
      where
        xs' = take k as
        sm' = sum xs'

solve :: Int -> [Int] -> Double
solve k p = sum $ map f mx
  where
    mx = fnc k p
    sm n = let n' = fromIntegral n 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