import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, k = map(int, readline().split())
p = list(map(int, readline().split()))

tmp = [(i+1)/2 for i in p]
cs = list(np.cumsum(tmp))

if n == k:
    print(cs[-1])
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans) import sys sys import numpy as np numpy read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines n, k = map(int, readline().split()) n map(int, readline().split()) map int readline().split() ().split () readline split k p = list(map(int, readline().split())) p list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split (i+1)/2 for i in p for i in p i p for i in p (i+1)/2 i+1 i 1 2 tmp = [(i+1)/2 for i in p] tmp [(i+1)/2 for i in p] cs = list(np.cumsum(tmp)) cs list(np.cumsum(tmp)) list np.cumsum(tmp) np.cumsum np cumsum tmp if n == k:
    print(cs[-1])
    exit() n == k n k print(cs[-1]) print cs[-1] cs -1 exit() exit ans = 0 ans 0 for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i]) i range(n - k) range n - k n k ans = max(ans, cs[i + k] - cs[i]) ans max(ans, cs[i + k] - cs[i]) max ans cs[i + k] - cs[i] cs[i + k] cs i + k i k cs[i] cs i print(ans) print ans cs = list(np.cumsum(tmp)) list(np.cumsum(tmp)) cs ans = max(ans, cs[i + k] - cs[i]) max(ans, cs[i + k] - cs[i]) ans read = sys.stdin.buffer.read sys.stdin.buffer.read read tmp = [(i+1)/2 for i in p] [(i+1)/2 for i in p] tmp readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline p = list(map(int, readline().split())) list(map(int, readline().split())) p ans = 0 0 ans n, k = map(int, readline().split()) map(int, readline().split()) n k = map(int, readline().split()) map(int, readline().split()) k
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, k = map(int, readline().split())
p = list(map(int, readline().split()))

tmp = [(i+1)/2 for i in p]
cs = list(np.cumsum(tmp))

if n == k:
    print(cs[-1])
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans)