import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, k = inintm()
P = inintl()

s = [0]*(n+1)
ans = 0

for i in range(n):
    s[i+1] = s[i]+(1 + (P[i]-1)*0.5)

for i in range(n-k+1):
    if s[i+k] - s[i] > ans:
        ans = s[i+k] - s[i]

print(ans) import sys sys inint = lambda: int(sys.stdin.readline()) inint lambda: int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline inintm = lambda: map(int, sys.stdin.readline().split()) inintm 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 inintl = lambda: list(inintm()) inintl lambda: list(inintm()) list(inintm()) list inintm() inintm instrm = lambda: map(str, sys.stdin.readline().split()) instrm lambda: map(str, sys.stdin.readline().split()) map(str, sys.stdin.readline().split()) map str sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split instrl = lambda: list(instrm()) instrl lambda: list(instrm()) list(instrm()) list instrm() instrm n, k = inintm() n inintm() inintm k P = inintl() P inintl() inintl s = [0]*(n+1) s [0]*(n+1) [0] 0 n+1 n 1 ans = 0 ans 0 for i in range(n):
    s[i+1] = s[i]+(1 + (P[i]-1)*0.5) i range(n) range n s[i+1] = s[i]+(1 + (P[i]-1)*0.5) s[i+1] s i+1 i 1 s[i]+(1 + (P[i]-1)*0.5) s[i] s i 1 + (P[i]-1)*0.5 1 (P[i]-1)*0.5 P[i]-1 P[i] P i 1 0.5 for i in range(n-k+1):
    if s[i+k] - s[i] > ans:
        ans = s[i+k] - s[i] i range(n-k+1) range n-k+1 n-k n k 1 if s[i+k] - s[i] > ans:
        ans = s[i+k] - s[i] s[i+k] - s[i] > ans s[i+k] - s[i] s[i+k] s i+k i k s[i] s i ans ans = s[i+k] - s[i] ans s[i+k] - s[i] s[i+k] s i+k i k s[i] s i print(ans) print ans n, k = inintm() inintm() n k = inintm() inintm() k inint = lambda: int(sys.stdin.readline()) lambda: int(sys.stdin.readline()) inint ans = s[i+k] - s[i] s[i+k] - s[i] ans inintl = lambda: list(inintm()) lambda: list(inintm()) inintl inintm = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) inintm instrm = lambda: map(str, sys.stdin.readline().split()) lambda: map(str, sys.stdin.readline().split()) instrm instrl = lambda: list(instrm()) lambda: list(instrm()) instrl s = [0]*(n+1) [0]*(n+1) s P = inintl() inintl() P ans = 0 0 ans
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, k = inintm()
P = inintl()

s = [0]*(n+1)
ans = 0

for i in range(n):
    s[i+1] = s[i]+(1 + (P[i]-1)*0.5)

for i in range(n-k+1):
    if s[i+k] - s[i] > ans:
        ans = s[i+k] - s[i]

print(ans)