n,k=[int(i) for i in input().split()]
p=[(int(i)+1)/2 for i in input().split()]

ans=0
sum_num=sum(p[:k])
for i in range(n-k+1):
    if i==0:
        sum_num = sum(p[:k])
    else:
        sum_num+=p[i+k-1]-p[i-1]
    ans=max(ans,sum_num)
print(ans) 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)+1)/2 for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() (int(i)+1)/2 int(i)+1 int(i) int i 1 2 p=[(int(i)+1)/2 for i in input().split()] p [(int(i)+1)/2 for i in input().split()] ans=0 ans 0 sum_num=sum(p[:k]) sum_num sum(p[:k]) sum p[:k] p :k k for i in range(n-k+1):
    if i==0:
        sum_num = sum(p[:k])
    else:
        sum_num+=p[i+k-1]-p[i-1]
    ans=max(ans,sum_num) i range(n-k+1) range n-k+1 n-k n k 1 if i==0:
        sum_num = sum(p[:k])
    else:
        sum_num+=p[i+k-1]-p[i-1]
     i==0 i 0 sum_num = sum(p[:k]) sum_num sum(p[:k]) sum p[:k] p :k k sum_num+=p[i+k-1]-p[i-1] sum_num p[i+k-1]-p[i-1] p[i+k-1] p i+k-1 i+k i k 1 p[i-1] p i-1 i 1 ans=max(ans,sum_num) ans max(ans,sum_num) max ans sum_num print(ans) print ans ans=0 0 ans sum_num=sum(p[:k]) sum(p[:k]) sum_num sum_num = sum(p[:k]) sum(p[:k]) sum_num n,k=[int(i) for i in input().split()] [int(i) for i in input().split()] n sum_num+=p[i+k-1]-p[i-1] p[i+k-1]-p[i-1] sum_num k=[int(i) for i in input().split()] [int(i) for i in input().split()] k ans=max(ans,sum_num) max(ans,sum_num) ans p=[(int(i)+1)/2 for i in input().split()] [(int(i)+1)/2 for i in input().split()] p
n,k=[int(i) for i in input().split()]
p=[(int(i)+1)/2 for i in input().split()]

ans=0
sum_num=sum(p[:k])
for i in range(n-k+1):
    if i==0:
        sum_num = sum(p[:k])
    else:
        sum_num+=p[i+k-1]-p[i-1]
    ans=max(ans,sum_num)
print(ans)