N,K=list(map(int,input().split()))

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

S=[0]*(N+1)





for i in range(N):

    S[i+1]=S[i]+p[i]

    

ans=0

for i in range(K,N+1):

    temp=S[i]-S[i-K]

    ans=max(ans,temp)

    

print(((ans+K)/2))







import sys

input = sys.stdin.readline



def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N,K=MI()

    P=LI()

    S=[0]*(N+1)

    

    for i in range(N):

        S[i+1]=S[i]+P[i]

        

    M=0

    for i in range(N-K+1):

        temp=S[K+i]-S[i]

        M=max(M,temp)

        

    ans=(M+K)/2

    print(ans)



main()

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
S = [0] * (N + 1)
for i in range(N):
    S[i + 1] = S[i] + p[i]
ans = 0
for i in range(K, N + 1):
    temp = S[i] - S[i - K]
    ans = max(ans, temp)
print(((ans + K) / 2))

import sys

input = sys.stdin.readline


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N, K = MI()
    P = LI()
    S = [0] * (N + 1)
    for i in range(N):
        S[i + 1] = S[i] + P[i]
    M = 0
    for i in range(N - K + 1):
        temp = S[K + i] - S[i]
        M = max(M, temp)
    ans = (M + K) / 2
    print(ans)


main()

-N, K = list(map(int, input().split())) -p = list(map(int, input().split())) -S = [0] * (N + 1) -for i in range(N): -    S[i + 1] = S[i] + p[i] -ans = 0 -for i in range(K, N + 1): -    temp = S[i] - S[i - K] -    ans = max(ans, temp) -print(((ans + K) / 2)) +import sys + +input = sys.stdin.readline + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N, K = MI() +    P = LI() +    S = [0] * (N + 1) +    for i in range(N): +        S[i + 1] = S[i] + P[i] +    M = 0 +    for i in range(N - K + 1): +        temp = S[K + i] - S[i] +        M = max(M, temp) +    ans = (M + K) / 2 +    print(ans) + + +main()