N, K = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
P2 = [(((P[i]+1)) / 2) for i in range(N)]
# i番目は1~P[i]の値を出す
# P[i]が大きいものからK個選んで期待値を求める
# 幅が最大のところを見つける
s = 0
init = 0
for i in range(K):
    s += P2[i] 
tmp = s
for i in range(1, N-K+1):
    tmp = tmp - P2[i-1] + P2[i+K-1]
    if s < tmp:
        s = tmp
        init = i

print(s) 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) 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 P = [int(i) for i in input().split()] P [int(i) for i in input().split()] (((P[i]+1)) / 2) for i in range(N) for i in range(N) i range(N) range N for i in range(N) ((P[i]+1)) / 2 P[i]+1 P[i] P i 1 2 P2 = [(((P[i]+1)) / 2) for i in range(N)] P2 [(((P[i]+1)) / 2) for i in range(N)] s = 0 s 0 init = 0 init 0 for i in range(K):
    s += P2[i]  i range(K) range K s += P2[i] s P2[i] P2 i tmp = s tmp s for i in range(1, N-K+1):
    tmp = tmp - P2[i-1] + P2[i+K-1]
    if s < tmp:
        s = tmp
        init = i i range(1, N-K+1) range 1 N-K+1 N-K N K 1 tmp = tmp - P2[i-1] + P2[i+K-1] tmp tmp - P2[i-1] + P2[i+K-1] tmp - P2[i-1] tmp P2[i-1] P2 i-1 i 1 P2[i+K-1] P2 i+K-1 i+K i K 1 if s < tmp:
        s = tmp
        init = i s < tmp s tmp s = tmp s tmp init = i init i print(s) print s K = [int(i) for i in input().split()] [int(i) for i in input().split()] K N, K = [int(i) for i in input().split()] [int(i) for i in input().split()] N init = 0 0 init P = [int(i) for i in input().split()] [int(i) for i in input().split()] P P2 = [(((P[i]+1)) / 2) for i in range(N)] [(((P[i]+1)) / 2) for i in range(N)] P2 s = 0 0 s tmp = tmp - P2[i-1] + P2[i+K-1] tmp - P2[i-1] + P2[i+K-1] tmp tmp = s s tmp s += P2[i] P2[i] s init = i i init s = tmp tmp s
N, K = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
P2 = [(((P[i]+1)) / 2) for i in range(N)]
# i番目は1~P[i]の値を出す
# P[i]が大きいものからK個選んで期待値を求める
# 幅が最大のところを見つける
s = 0
init = 0
for i in range(K):
    s += P2[i] 
tmp = s
for i in range(1, N-K+1):
    tmp = tmp - P2[i-1] + P2[i+K-1]
    if s < tmp:
        s = tmp
        init = i

print(s)