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

# 「和の期待値」は「期待値の和」なので、期待値を求めておく
for i in range(N):
  p[i] = (1+p[i])/2

# すると結局[(p_1+1)/2,...,(p_N+1)/2]の配列から、隣接するK個の和の最大値を求めればよい
# N=10^5なので、O(N)で解く
# 2重ループはO(NK)で間に合わない
# 累積和を用いるとO(N)で解ける！（累積和とは、配列上の区間の総和を求める処理を高速化する手法）
S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + p[i]
'''
S[0] = 0
S[1] = p[0]
S[2] = p[0] + p[1]
S[N] = p[0] + ... + p[N-1]
 
S[K]-S[0] = p[K-1] + ... + p[0]
S[K+1]-S[1] = p[K] + ... + p[1]
S[K+2]-S[2] = p[K+1] + ... + p[2]
S[N]-S[N-K] = p[N-1] + ... + p[N-K]
'''
 
ans = 0 # ans = max(S[K]-S[0],S[K+1]-S[1],...,S[N]-S[N-K])
for i in range(N-K+1):
  ans = max(ans, S[i+K] - S[i])
  
print(ans) 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 for i in range(N):
  p[i] = (1+p[i])/2

# すると結局[(p_1+1)/2,...,(p_N+1)/2]の配列から、隣接するK個の和の最大値を求めればよい
# N=10^5なので、O(N)で解く
# 2重ループはO(NK)で間に合わない
# 累積和を用いるとO(N)で解ける！（累積和とは、配列上の区間の総和を求める処理を高速化する手法） i range(N) range N p[i] = (1+p[i])/2 p[i] p i (1+p[i])/2 1+p[i] 1 p[i] p i 2 S = [0]*(N+1) S [0]*(N+1) [0] 0 N+1 N 1 for i in range(N):
  S[i+1] = S[i] + p[i] i range(N) range N S[i+1] = S[i] + p[i] S[i+1] S i+1 i 1 S[i] + p[i] S[i] S i p[i] p i '''
S[0] = 0
S[1] = p[0]
S[2] = p[0] + p[1]
S[N] = p[0] + ... + p[N-1]
 
S[K]-S[0] = p[K-1] + ... + p[0]
S[K+1]-S[1] = p[K] + ... + p[1]
S[K+2]-S[2] = p[K+1] + ... + p[2]
S[N]-S[N-K] = p[N-1] + ... + p[N-K]
''' ans = 0 ans 0 for i in range(N-K+1):
  ans = max(ans, S[i+K] - S[i])
   i range(N-K+1) range N-K+1 N-K N K 1 ans = max(ans, S[i+K] - S[i]) ans max(ans, S[i+K] - S[i]) max ans S[i+K] - S[i] S[i+K] S i+K i K S[i] S i print(ans) print ans ans = max(ans, S[i+K] - S[i]) max(ans, S[i+K] - S[i]) ans p = list(map(int, input().split())) list(map(int, input().split())) p S = [0]*(N+1) [0]*(N+1) S K = map(int, input().split()) map(int, input().split()) K N, K = map(int, input().split()) map(int, input().split()) N ans = 0 0 ans
N, K = map(int, input().split())
p = list(map(int, input().split()))

# 「和の期待値」は「期待値の和」なので、期待値を求めておく
for i in range(N):
  p[i] = (1+p[i])/2

# すると結局[(p_1+1)/2,...,(p_N+1)/2]の配列から、隣接するK個の和の最大値を求めればよい
# N=10^5なので、O(N)で解く
# 2重ループはO(NK)で間に合わない
# 累積和を用いるとO(N)で解ける！（累積和とは、配列上の区間の総和を求める処理を高速化する手法）
S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + p[i]
'''
S[0] = 0
S[1] = p[0]
S[2] = p[0] + p[1]
S[N] = p[0] + ... + p[N-1]
 
S[K]-S[0] = p[K-1] + ... + p[0]
S[K+1]-S[1] = p[K] + ... + p[1]
S[K+2]-S[2] = p[K+1] + ... + p[2]
S[N]-S[N-K] = p[N-1] + ... + p[N-K]
'''
 
ans = 0 # ans = max(S[K]-S[0],S[K+1]-S[1],...,S[N]-S[N-K])
for i in range(N-K+1):
  ans = max(ans, S[i+K] - S[i])
  
print(ans)