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

readInt = ((+) 0) . head <$> readLine
readLine = map (read . BS.unpack) . BS.words <$> BS.getLine
readStrings n = replicateM n $ BS.unpack <$> BS.getLine
readLines n = replicateM n readLine
toPair [x, y] = (x, y)


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

solve :: Int -> [Int] -> Double
solve k p = maximum $ zipWith (-) (drop k sums) sums
 where
  expected = map ((\x -> (x + 1) / 2) . fromIntegral) p
  sums     = scanl' (+) 0 expected
