import           Control.Monad
import           Control.Monad.ST
import qualified Data.Array                    as A
import qualified Data.Array.Unboxed            as AU
import qualified Data.ByteString.Char8         as BS
import           Data.Char
import           Data.Int
import qualified Data.IntMap                   as M
import           Data.List
import           Data.Maybe
import           Data.Ord
import           Data.Time
import qualified Data.Vector                   as V
import qualified Data.Vector.Mutable           as VM
import qualified Data.Vector.Unboxed           as VU
import qualified Data.Vector.Unboxed.Mutable   as VUM

readLine :: Read a => IO [a]
readLine = map (read . BS.unpack) . BS.words <$> BS.getLine

readLines :: Read a => Int -> IO [[a]]
readLines n = replicateM n readLine

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)

main :: IO ()
main = do
  [n, k] <- readLine
  p      <- readLine
  print $ solve n k p

solve :: Int -> Int -> [Int] -> Double
solve n k p = fromIntegral (p' + k) / 2
 where
  p' = maximum $ map (sum . take k) $ filter (\x -> length x >= k) $ tails p
  f :: [Double] -> Double -> Double
  f []       acc = acc
  f (a : as) acc = f as (acc + (1 + a) / 2)
