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))

cs = [0]*n
cs[0] = tmp[0]
for i in range(len(tmp)-1):
    cs[i + 1] = cs[i] + tmp[i + 1]

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 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 = [0]*n cs [0]*n [0] 0 n cs[0] = tmp[0] cs[0] cs 0 tmp[0] tmp 0 for i in range(len(tmp)-1):
    cs[i + 1] = cs[i] + tmp[i + 1] i range(len(tmp)-1) range len(tmp)-1 len(tmp) len tmp 1 cs[i + 1] = cs[i] + tmp[i + 1] cs[i + 1] cs i + 1 i 1 cs[i] + tmp[i + 1] cs[i] cs i tmp[i + 1] tmp i + 1 i 1 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 ans = max(ans, cs[i + k] - cs[i]) max(ans, cs[i + k] - cs[i]) ans tmp = [(i+1)/2 for i in p] [(i+1)/2 for i in p] tmp p = list(map(int, readline().split())) list(map(int, readline().split())) p cs = [0]*n [0]*n cs readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline ans = 0 0 ans read = sys.stdin.buffer.read sys.stdin.buffer.read read readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines k = map(int, readline().split()) map(int, readline().split()) k n, k = map(int, readline().split()) map(int, readline().split()) n
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))

cs = [0]*n
cs[0] = tmp[0]
for i in range(len(tmp)-1):
    cs[i + 1] = cs[i] + tmp[i + 1]

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)