#!/usr/bin/env python
# coding: utf-8

# In[43]:


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


# In[44]:


le = [(x+1)/2 for x in p]
e = sum(le[:K])
ans = e
for i in range(N-K):
    e -= le[i]
    e += le[i+K]
    ans = max(ans ,e)
print(ans)


# In[ ]:



 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 (x+1)/2 for x in p for x in p x p for x in p (x+1)/2 x+1 x 1 2 le = [(x+1)/2 for x in p] le [(x+1)/2 for x in p] e = sum(le[:K]) e sum(le[:K]) sum le[:K] le :K K ans = e ans e for i in range(N-K):
    e -= le[i]
    e += le[i+K]
    ans = max(ans ,e) i range(N-K) range N-K N K e -= le[i] e le[i] le i e += le[i+K] e le[i+K] le i+K i K ans = max(ans ,e) ans max(ans ,e) max ans e print(ans) print ans K = map(int, input().split()) map(int, input().split()) K e += le[i+K] le[i+K] e ans = e e ans le = [(x+1)/2 for x in p] [(x+1)/2 for x in p] le N,K = map(int, input().split()) map(int, input().split()) N p = list(map(int, input().split())) list(map(int, input().split())) p ans = max(ans ,e) max(ans ,e) ans e -= le[i] le[i] e e = sum(le[:K]) sum(le[:K]) e
#!/usr/bin/env python
# coding: utf-8

# In[43]:


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


# In[44]:


le = [(x+1)/2 for x in p]
e = sum(le[:K])
ans = e
for i in range(N-K):
    e -= le[i]
    e += le[i+K]
    ans = max(ans ,e)
print(ans)


# In[ ]:




