n,k = map(int,input().split())
p = list(map(int,input().split()))
q = [0]*n
for i in range(n):
  q[i] = (1+p[i])/2
s = [0]*(n+1)
for j in range(n):
  s[j+1]=s[j]+q[j]
t = k+1
answer = s[k]-s[0]
while(t<=n):
  answer = max(answer,s[t]-s[t-k])
  t +=1
print(answer) 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 q = [0]*n q [0]*n [0] 0 n for i in range(n):
  q[i] = (1+p[i])/2 i range(n) range n q[i] = (1+p[i])/2 q[i] q 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 j in range(n):
  s[j+1]=s[j]+q[j] j range(n) range n s[j+1]=s[j]+q[j] s[j+1] s j+1 j 1 s[j]+q[j] s[j] s j q[j] q j t = k+1 t k+1 k 1 answer = s[k]-s[0] answer s[k]-s[0] s[k] s k s[0] s 0 while(t<=n):
  answer = max(answer,s[t]-s[t-k])
  t +=1 t<=n t n answer = max(answer,s[t]-s[t-k]) answer max(answer,s[t]-s[t-k]) max answer s[t]-s[t-k] s[t] s t s[t-k] s t-k t k t +=1 t 1 print(answer) print answer answer = s[k]-s[0] s[k]-s[0] answer p = list(map(int,input().split())) list(map(int,input().split())) p q = [0]*n [0]*n q answer = max(answer,s[t]-s[t-k]) max(answer,s[t]-s[t-k]) answer k = map(int,input().split()) map(int,input().split()) k t = k+1 k+1 t n,k = map(int,input().split()) map(int,input().split()) n t +=1 1 t s = [0]*(n+1) [0]*(n+1) s
n,k = map(int,input().split())
p = list(map(int,input().split()))
q = [0]*n
for i in range(n):
  q[i] = (1+p[i])/2
s = [0]*(n+1)
for j in range(n):
  s[j+1]=s[j]+q[j]
t = k+1
answer = s[k]-s[0]
while(t<=n):
  answer = max(answer,s[t]-s[t-k])
  t +=1
print(answer)