import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max) import numpy as np numpy 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 s=[] s [] p=np.array(p) p np.array(p) np.array np array p sum=0 sum 0 for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s) i range(n) range n sum+=(1+p[i])/2 sum (1+p[i])/2 1+p[i] 1 p[i] p i 2 s.append(sum) s.append s append sum if k==n:
  print(s[-1])
  exit() k==n k n print(s[-1]) print s[-1] s -1 exit() exit max=s[k-1]-s[0] max s[k-1]-s[0] s[k-1] s k-1 k 1 s[0] s 0 for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
   j range(1,n-k) range 1 n-k n k if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
   max<= s[j+k]-s[j] max s[j+k]-s[j] s[j+k] s j+k j k s[j] s j max=s[j+k]-s[j] max s[j+k]-s[j] s[j+k] s j+k j k s[j] s j print(max) print max max=s[k-1]-s[0] s[k-1]-s[0] max max=s[j+k]-s[j] s[j+k]-s[j] max n,k=map(int, input().split()) map(int, input().split()) n sum=0 0 sum p=list(map(int,input().split())) list(map(int,input().split())) p k=map(int, input().split()) map(int, input().split()) k s=[] [] s sum+=(1+p[i])/2 (1+p[i])/2 sum p=np.array(p) np.array(p) p
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)