import numpy as np
N,K = map(int,input().split())
p = list(map(int,input().split()))

l = []
for i in range(N):
    l.append((1+p[i])/2)

a = [0] * N
a[0] = l[0]
for i in range(1,len(l)):
    a[i] = a[i-1] + l[i]

ans = 0
for i in range(K,len(l)):
    ans = max(ans,a[i]-a[i-K])

if N - K == 0:
    print(max(a))
else:
    print(ans) import numpy as np numpy N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K p = list(map(int,input().split())) p list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split l = [] l [] for i in range(N):
    l.append((1+p[i])/2) i range(N) range N l.append((1+p[i])/2) l.append l append (1+p[i])/2 1+p[i] 1 p[i] p i 2 a = [0] * N a [0] * N [0] 0 N a[0] = l[0] a[0] a 0 l[0] l 0 for i in range(1,len(l)):
    a[i] = a[i-1] + l[i] i range(1,len(l)) range 1 len(l) len l a[i] = a[i-1] + l[i] a[i] a i a[i-1] + l[i] a[i-1] a i-1 i 1 l[i] l i ans = 0 ans 0 for i in range(K,len(l)):
    ans = max(ans,a[i]-a[i-K]) i range(K,len(l)) range K len(l) len l ans = max(ans,a[i]-a[i-K]) ans max(ans,a[i]-a[i-K]) max ans a[i]-a[i-K] a[i] a i a[i-K] a i-K i K if N - K == 0:
    print(max(a))
else:
    print(ans) N - K == 0 N - K N K 0 print(max(a)) print max(a) max a print(ans) print ans ans = 0 0 ans K = map(int,input().split()) map(int,input().split()) K a = [0] * N [0] * N a ans = max(ans,a[i]-a[i-K]) max(ans,a[i]-a[i-K]) ans N,K = map(int,input().split()) map(int,input().split()) N p = list(map(int,input().split())) list(map(int,input().split())) p l = [] [] l
import numpy as np
N,K = map(int,input().split())
p = list(map(int,input().split()))

l = []
for i in range(N):
    l.append((1+p[i])/2)

a = [0] * N
a[0] = l[0]
for i in range(1,len(l)):
    a[i] = a[i-1] + l[i]

ans = 0
for i in range(K,len(l)):
    ans = max(ans,a[i]-a[i-K])

if N - K == 0:
    print(max(a))
else:
    print(ans)