#!/usr/bin/env python3

n, k, *P = list(map(int, open(0).read().split()))

p = [(i + 1) / 2 for i in P]

c = sum(p[:k])

ans = c

for i in range(n - k):

    c = c + p[i + k] - p[i]

    ans = max(c, ans)

print(ans)

#!/usr/bin/env python3

n, k, *P = list(map(int, open(0).read().split()))

p = [(i + 1) / 2 for i in P]

s = [float()]

for i in range(n):

    s.append(s[i] + p[i])

print((max(s[i + k] - s[i] for i in range(n - k + 1))))

#!/usr/bin/env python3
n, k, *P = list(map(int, open(0).read().split()))
p = [(i + 1) / 2 for i in P]
c = sum(p[:k])
ans = c
for i in range(n - k):
    c = c + p[i + k] - p[i]
    ans = max(c, ans)
print(ans)

#!/usr/bin/env python3
n, k, *P = list(map(int, open(0).read().split()))
p = [(i + 1) / 2 for i in P]
s = [float()]
for i in range(n):
    s.append(s[i] + p[i])
print((max(s[i + k] - s[i] for i in range(n - k + 1))))

-c = sum(p[:k]) -ans = c -for i in range(n - k): -    c = c + p[i + k] - p[i] -    ans = max(c, ans) -print(ans) +s = [float()] +for i in range(n): +    s.append(s[i] + p[i]) +print((max(s[i + k] - s[i] for i in range(n - k + 1))))