import sys
import numpy as np
input = sys.stdin.readline

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

pn1 = p - 1

ans = sum(pn1[:K])
spb = ans
for i in range(N-K):
    sp = spb -pn1[i] + pn1[i+K]
    #print(sp,spb,pn1[i],pn1[i+K])
    ans = max(sp,ans)
    spb = sp
print(ans/2+K)
 import sys sys import numpy as np numpy input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N,K = list(map(int,input().split())) N list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split K p = np.array(list(map(int,input().split()))) p np.array(list(map(int,input().split()))) np.array np array list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split pn1 = p - 1 pn1 p - 1 p 1 ans = sum(pn1[:K]) ans sum(pn1[:K]) sum pn1[:K] pn1 :K K spb = ans spb ans for i in range(N-K):
    sp = spb -pn1[i] + pn1[i+K]
    #print(sp,spb,pn1[i],pn1[i+K])
    ans = max(sp,ans)
    spb = sp i range(N-K) range N-K N K sp = spb -pn1[i] + pn1[i+K] sp spb -pn1[i] + pn1[i+K] spb -pn1[i] spb pn1[i] pn1 i pn1[i+K] pn1 i+K i K ans = max(sp,ans) ans max(sp,ans) max sp ans spb = sp spb sp print(ans/2+K) print ans/2+K ans/2 ans 2 K spb = sp sp spb K = list(map(int,input().split())) list(map(int,input().split())) K ans = sum(pn1[:K]) sum(pn1[:K]) ans ans = max(sp,ans) max(sp,ans) ans input = sys.stdin.readline sys.stdin.readline input p = np.array(list(map(int,input().split()))) np.array(list(map(int,input().split()))) p N,K = list(map(int,input().split())) list(map(int,input().split())) N pn1 = p - 1 p - 1 pn1 spb = ans ans spb sp = spb -pn1[i] + pn1[i+K] spb -pn1[i] + pn1[i+K] sp
import sys
import numpy as np
input = sys.stdin.readline

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

pn1 = p - 1

ans = sum(pn1[:K])
spb = ans
for i in range(N-K):
    sp = spb -pn1[i] + pn1[i+K]
    #print(sp,spb,pn1[i],pn1[i+K])
    ans = max(sp,ans)
    spb = sp
print(ans/2+K)

