# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 22:29:36 2020

@author: liang
"""
N, K = map(int, input().split())

P = [1 + (int(p)-1)*0.5 for p in input().split()]
#print(P)

tmp = sum(P[:K])
ans = tmp
for i in range(N-K):
    tmp += P[K+i] - P[i]
    if tmp > ans:
        ans = tmp
    
print(ans) """
Created on Mon Sep  7 22:29:36 2020

@author: liang
""" N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K 1 + (int(p)-1)*0.5 for p in input().split() for p in input().split() p input().split() ().split () input split for p in input().split() 1 + (int(p)-1)*0.5 1 (int(p)-1)*0.5 int(p)-1 int(p) int p 1 0.5 P = [1 + (int(p)-1)*0.5 for p in input().split()] P [1 + (int(p)-1)*0.5 for p in input().split()] tmp = sum(P[:K]) tmp sum(P[:K]) sum P[:K] P :K K ans = tmp ans tmp for i in range(N-K):
    tmp += P[K+i] - P[i]
    if tmp > ans:
        ans = tmp
     i range(N-K) range N-K N K tmp += P[K+i] - P[i] tmp P[K+i] - P[i] P[K+i] P K+i K i P[i] P i if tmp > ans:
        ans = tmp
     tmp > ans tmp ans ans = tmp ans tmp print(ans) print ans tmp += P[K+i] - P[i] P[K+i] - P[i] tmp P = [1 + (int(p)-1)*0.5 for p in input().split()] [1 + (int(p)-1)*0.5 for p in input().split()] P ans = tmp tmp ans N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K tmp = sum(P[:K]) sum(P[:K]) tmp ans = tmp tmp ans
# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 22:29:36 2020

@author: liang
"""
N, K = map(int, input().split())

P = [1 + (int(p)-1)*0.5 for p in input().split()]
#print(P)

tmp = sum(P[:K])
ans = tmp
for i in range(N-K):
    tmp += P[K+i] - P[i]
    if tmp > ans:
        ans = tmp
    
print(ans)