import sys
from itertools import accumulate

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = [(i+1)/2 for i in rl()]
a = [0] + list(accumulate(a))
ans = 0
for i in range(n-k+1):
    ans = max(ans, a[i+k] - a[i])
print(ans) import sys sys from itertools import accumulate rm = lambda: map(int, sys.stdin.readline().split()) rm lambda: map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split rl = lambda: list(map(int, sys.stdin.readline().split())) rl lambda: list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split n, k = rm() n rm() rm k (i+1)/2 for i in rl() for i in rl() i rl() rl for i in rl() (i+1)/2 i+1 i 1 2 a = [(i+1)/2 for i in rl()] a [(i+1)/2 for i in rl()] a = [0] + list(accumulate(a)) a [0] + list(accumulate(a)) [0] 0 list(accumulate(a)) list accumulate(a) accumulate a ans = 0 ans 0 for i in range(n-k+1):
    ans = max(ans, a[i+k] - a[i]) i range(n-k+1) range n-k+1 n-k n k 1 ans = max(ans, a[i+k] - a[i]) ans max(ans, a[i+k] - a[i]) max ans a[i+k] - a[i] a[i+k] a i+k i k a[i] a i print(ans) print ans rm = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) rm ans = 0 0 ans a = [(i+1)/2 for i in rl()] [(i+1)/2 for i in rl()] a a = [0] + list(accumulate(a)) [0] + list(accumulate(a)) a rl = lambda: list(map(int, sys.stdin.readline().split())) lambda: list(map(int, sys.stdin.readline().split())) rl ans = max(ans, a[i+k] - a[i]) max(ans, a[i+k] - a[i]) ans n, k = rm() rm() n k = rm() rm() k
import sys
from itertools import accumulate

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = [(i+1)/2 for i in rl()]
a = [0] + list(accumulate(a))
ans = 0
for i in range(n-k+1):
    ans = max(ans, a[i+k] - a[i])
print(ans)