local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
----
-- D
local N, K = read.nn()
local P = read.N(N)
local E = {}
local S = {}
S[0] = 0
for i=1,N do
    E[i] = (P[i] + 1) / 2
    S[i] = S[i-1] + E[i]
end
local ans = 0
for i=K,N do
    ans = math.max(ans, S[i] - S[i-K])
end
print(ans)