from numpy import *

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

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

Q = (N-K+1)*[0]

R = sum(P[0:K])

Q[0] = R



for n in range(1,N-K+1):

  R+=P[n-1+K]-P[n-1]

  Q[n] = R



S = argmax(Q)

print((0.5*(sum(P[S:S+K])+K)))
N,K = list(map(int,input().split()))

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

Q = sum(P[:K])

R = Q



for n in range(N-K):

  Q = Q-P[n]+P[n+K]

  R = max(Q,R)



print(((R+K)/2))
from numpy import *

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
Q = (N - K + 1) * [0]
R = sum(P[0:K])
Q[0] = R
for n in range(1, N - K + 1):
    R += P[n - 1 + K] - P[n - 1]
    Q[n] = R
S = argmax(Q)
print((0.5 * (sum(P[S : S + K]) + K)))

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
Q = sum(P[:K])
R = Q
for n in range(N - K):
    Q = Q - P[n] + P[n + K]
    R = max(Q, R)
print(((R + K) / 2))

-from numpy import * - -Q = (N - K + 1) * [0] -R = sum(P[0:K]) -Q[0] = R -for n in range(1, N - K + 1): -    R += P[n - 1 + K] - P[n - 1] -    Q[n] = R -S = argmax(Q) -print((0.5 * (sum(P[S : S + K]) + K))) +Q = sum(P[:K]) +R = Q +for n in range(N - K): +    Q = Q - P[n] + P[n + K] +    R = max(Q, R) +print(((R + K) / 2))