import itertools

n, k = map(int, input().split())
lis = list(map(int,input().split()))

exlis = []


for i in lis:
    a = (1+i)/2
    exlis.append(a)


nlis = list(itertools.accumulate(exlis))


ans  = nlis[k-1]
for j in range(n-k):
    tmp = nlis[j+k] - nlis[j]
    ans = max(ans, tmp)

print(ans) import itertools itertools n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k lis = list(map(int,input().split())) lis list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split exlis = [] exlis [] for i in lis:
    a = (1+i)/2
    exlis.append(a) i lis a = (1+i)/2 a (1+i)/2 1+i 1 i 2 exlis.append(a) exlis.append exlis append a nlis = list(itertools.accumulate(exlis)) nlis list(itertools.accumulate(exlis)) list itertools.accumulate(exlis) itertools.accumulate itertools accumulate exlis ans  = nlis[k-1] ans nlis[k-1] nlis k-1 k 1 for j in range(n-k):
    tmp = nlis[j+k] - nlis[j]
    ans = max(ans, tmp) j range(n-k) range n-k n k tmp = nlis[j+k] - nlis[j] tmp nlis[j+k] - nlis[j] nlis[j+k] nlis j+k j k nlis[j] nlis j ans = max(ans, tmp) ans max(ans, tmp) max ans tmp print(ans) print ans nlis = list(itertools.accumulate(exlis)) list(itertools.accumulate(exlis)) nlis lis = list(map(int,input().split())) list(map(int,input().split())) lis exlis = [] [] exlis ans  = nlis[k-1] nlis[k-1] ans tmp = nlis[j+k] - nlis[j] nlis[j+k] - nlis[j] tmp n, k = map(int, input().split()) map(int, input().split()) n a = (1+i)/2 (1+i)/2 a k = map(int, input().split()) map(int, input().split()) k ans = max(ans, tmp) max(ans, tmp) ans
import itertools

n, k = map(int, input().split())
lis = list(map(int,input().split()))

exlis = []


for i in lis:
    a = (1+i)/2
    exlis.append(a)


nlis = list(itertools.accumulate(exlis))


ans  = nlis[k-1]
for j in range(n-k):
    tmp = nlis[j+k] - nlis[j]
    ans = max(ans, tmp)

print(ans)