local function expected_value(n)
    return (n + 1) / 2.0
end

local function main()
    local n, k = io.read("*n", "n")
    local a, sum, ans = {}, {}, 0
    for i = 1, n do
        a[i] = expected_value(io.read("*n"))
    end
    sum[1] = a[1]
    for i = 2, n do
        sum[i] = sum[i - 1] + a[i]
    end
    ans = sum[k]
    for i = 1, n - k do
        ans = math.max(ans, sum[i + k] - sum[i])
    end
    print(ans)
end

main()
