def main():

    import sys

    input = sys.stdin.readline

    from itertools import accumulate



    def e(dice):

        ans = 0

        for r in range(1, dice+1):

            ans += r /dice

        return ans



    n, k = list(map(int, input().split()))

    p = list(map(int, input().split()))



    p_cum = [0] + list(accumulate(p))



    ma = 0

    ind = 0

    for i in range(k, n+1):

        temp = p_cum[i] - p_cum[i-k]

        if ma < temp:

            ma = temp

            ind = i



    x = p[ind-k:ind]



    print((sum(e(d) for d in x)))



if __name__ == '__main__':

    main()
from itertools import accumulate



n, k = list(map(int, input().split()))

p = [0] + list(accumulate([(int(d) + 1) / 2 for d in input().split()]))



ans = 0

for i in range(k, n+1):

    ans = max(ans, p[i] - p[i-k])



print(ans)
def main():
    import sys

    input = sys.stdin.readline
    from itertools import accumulate

    def e(dice):
        ans = 0
        for r in range(1, dice + 1):
            ans += r / dice
        return ans

    n, k = list(map(int, input().split()))
    p = list(map(int, input().split()))
    p_cum = [0] + list(accumulate(p))
    ma = 0
    ind = 0
    for i in range(k, n + 1):
        temp = p_cum[i] - p_cum[i - k]
        if ma < temp:
            ma = temp
            ind = i
    x = p[ind - k : ind]
    print((sum(e(d) for d in x)))


if __name__ == "__main__":
    main()

from itertools import accumulate

n, k = list(map(int, input().split()))
p = [0] + list(accumulate([(int(d) + 1) / 2 for d in input().split()]))
ans = 0
for i in range(k, n + 1):
    ans = max(ans, p[i] - p[i - k])
print(ans)

-def main(): -    import sys +from itertools import accumulate -    input = sys.stdin.readline -    from itertools import accumulate - -    def e(dice): -        ans = 0 -        for r in range(1, dice + 1): -            ans += r / dice -        return ans - -    n, k = list(map(int, input().split())) -    p = list(map(int, input().split())) -    p_cum = [0] + list(accumulate(p)) -    ma = 0 -    ind = 0 -    for i in range(k, n + 1): -        temp = p_cum[i] - p_cum[i - k] -        if ma < temp: -            ma = temp -            ind = i -    x = p[ind - k : ind] -    print((sum(e(d) for d in x))) - - -if __name__ == "__main__": -    main() +n, k = list(map(int, input().split())) +p = [0] + list(accumulate([(int(d) + 1) / 2 for d in input().split()])) +ans = 0 +for i in range(k, n + 1): +    ans = max(ans, p[i] - p[i - k]) +print(ans)