import itertools
n, k = (int(i) for i in input().split())
P = [int(i) for i in input().split()]

probs = list(itertools.accumulate([(1+p)/2 for p in P]))
probs.insert(0,0)

ans = 0

for i in range(n-k+1):
    ans = max(ans, -probs[i]+probs[i+k])

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

probs = list(itertools.accumulate([(1+p)/2 for p in P]))
probs.insert(0,0)

ans = 0

for i in range(n-k+1):
    ans = max(ans, -probs[i]+probs[i+k])

print(ans)
