#ABC154D

import sys

N, K = list(map(int, sys.stdin.readline().split()))

P = list(map(int, sys.stdin.readline().split()))



#print(P)



#期待値L

L = [0 for _ in range(N)]

for i in range(N):

    L[i] = (1+P[i])/2

#print(L)



#累積和S

S = [0 for i in range(N)]

S[0] = L[0]

for i in range(1, N):

    S[i] = S[i-1] + L[i]



#print(S)

total = S[K-1]

for i in range(N-K):

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

    if total < tmp:

        total = tmp



print(total)
#ABC154D

def main():

    import sys

    N, K = list(map(int, sys.stdin.readline().split()))

    P = list(map(int, sys.stdin.readline().split()))

    L =[0 for _ in range(N)]

    #期待値 (初項+末項)/2

    for i in range(N):

        L[i]=(1 +P[i])/2

    #print(L)

    #累積和

    for i in range(N-1):

        L[i+1] +=L[i]

    #print(L)

    ans = L[K-1]

    for i in range(N-K):

        s = L[i+K]-L[i]

        if ans < s:

            ans = s

    print(ans)



if __name__=='__main__':

    main()
# ABC154D
import sys

N, K = list(map(int, sys.stdin.readline().split()))
P = list(map(int, sys.stdin.readline().split()))
# print(P)
# 期待値L
L = [0 for _ in range(N)]
for i in range(N):
    L[i] = (1 + P[i]) / 2
# print(L)
# 累積和S
S = [0 for i in range(N)]
S[0] = L[0]
for i in range(1, N):
    S[i] = S[i - 1] + L[i]
# print(S)
total = S[K - 1]
for i in range(N - K):
    tmp = S[i + K] - S[i]
    if total < tmp:
        total = tmp
print(total)

# ABC154D
def main():
    import sys

    N, K = list(map(int, sys.stdin.readline().split()))
    P = list(map(int, sys.stdin.readline().split()))
    L = [0 for _ in range(N)]
    # 期待値 (初項+末項)/2
    for i in range(N):
        L[i] = (1 + P[i]) / 2
    # print(L)
    # 累積和
    for i in range(N - 1):
        L[i + 1] += L[i]
    # print(L)
    ans = L[K - 1]
    for i in range(N - K):
        s = L[i + K] - L[i]
        if ans < s:
            ans = s
    print(ans)


if __name__ == "__main__":
    main()

-import sys +def main(): +    import sys -N, K = list(map(int, sys.stdin.readline().split())) -P = list(map(int, sys.stdin.readline().split())) -# print(P) -# 期待値L -L = [0 for _ in range(N)] -for i in range(N): -    L[i] = (1 + P[i]) / 2 -# print(L) -# 累積和S -S = [0 for i in range(N)] -S[0] = L[0] -for i in range(1, N): -    S[i] = S[i - 1] + L[i] -# print(S) -total = S[K - 1] -for i in range(N - K): -    tmp = S[i + K] - S[i] -    if total < tmp: -        total = tmp -print(total) +    N, K = list(map(int, sys.stdin.readline().split())) +    P = list(map(int, sys.stdin.readline().split())) +    L = [0 for _ in range(N)] +    # 期待値 (初項+末項)/2 +    for i in range(N): +        L[i] = (1 + P[i]) / 2 +    # print(L) +    # 累積和 +    for i in range(N - 1): +        L[i + 1] += L[i] +    # print(L) +    ans = L[K - 1] +    for i in range(N - K): +        s = L[i + K] - L[i] +        if ans < s: +            ans = s +    print(ans) + + +if __name__ == "__main__": +    main()