local n, k = io.read("*n", "*n")
local t = {}
for i = 1, n do
  t[i] = io.read("*n")
end
local sum = 0
for i = 1, k do
  sum = sum + t[i]
end
local ret = sum
for i = k + 1, n do
  sum = sum + t[i] - t[i - k]
  ret = math.max(ret, sum)
end
print((ret + k) / 2)
