import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as VU
import Data.Char

solve :: VU.Vector Int -> Int -> Int -> Double
solve xs n k = maximum $ [f i | i<-[k..n]]
  where
    f i = (table VU.! i) - (table VU.! (i-k))
    zs = VU.zip xs xs 
    table :: VU.Vector Double
    table = VU.scanl' step 0.0 zs
    step acc (p,q) = acc + r
      where
        p' = fromIntegral $ p * (p+1) `div` 2
        q' = fromIntegral q
        r = p' / q'

main = do
  [n,k] <- map read . words <$> getLine :: IO [Int]
  xs <- VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
  print $ solve xs n k
