n, k = map(int, input().split())
p = list(map(int, input().split()))
e = lambda x: 0.5*(x+1)
if k == 1:
    res = e(max(p))
else:
    s = [0]
    s[0] = sum(p[:k])
    for i in range(1, n-k+1):
        s.append(s[i-1] - p[i-1] + p[i+k-1])
    idx = s.index(max(s))
    res = sum([e(p[i]) for i in range(idx, idx+k)])
print(res) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k p = list(map(int, input().split())) p list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split e = lambda x: 0.5*(x+1) e lambda x: 0.5*(x+1) 0.5*(x+1) 0.5 x+1 x 1 x if k == 1:
    res = e(max(p))
else:
    s = [0]
    s[0] = sum(p[:k])
    for i in range(1, n-k+1):
        s.append(s[i-1] - p[i-1] + p[i+k-1])
    idx = s.index(max(s))
    res = sum([e(p[i]) for i in range(idx, idx+k)]) k == 1 k 1 res = e(max(p)) res e(max(p)) e max(p) max p s = [0] s [0] 0 s[0] = sum(p[:k]) s[0] s 0 sum(p[:k]) sum p[:k] p :k k for i in range(1, n-k+1):
        s.append(s[i-1] - p[i-1] + p[i+k-1])
     i range(1, n-k+1) range 1 n-k+1 n-k n k 1 s.append(s[i-1] - p[i-1] + p[i+k-1]) s.append s append s[i-1] - p[i-1] + p[i+k-1] s[i-1] - p[i-1] s[i-1] s i-1 i 1 p[i-1] p i-1 i 1 p[i+k-1] p i+k-1 i+k i k 1 idx = s.index(max(s)) idx s.index(max(s)) s.index s index max(s) max s e(p[i]) for i in range(idx, idx+k) for i in range(idx, idx+k) i range(idx, idx+k) range idx idx+k idx k for i in range(idx, idx+k) e(p[i]) e p[i] p i res = sum([e(p[i]) for i in range(idx, idx+k)]) res sum([e(p[i]) for i in range(idx, idx+k)]) sum [e(p[i]) for i in range(idx, idx+k)] print(res) print res res = sum([e(p[i]) for i in range(idx, idx+k)]) sum([e(p[i]) for i in range(idx, idx+k)]) res idx = s.index(max(s)) s.index(max(s)) idx s = [0] [0] s k = map(int, input().split()) map(int, input().split()) k e = lambda x: 0.5*(x+1) lambda x: 0.5*(x+1) e res = e(max(p)) e(max(p)) res p = list(map(int, input().split())) list(map(int, input().split())) p n, k = map(int, input().split()) map(int, input().split()) n
n, k = map(int, input().split())
p = list(map(int, input().split()))
e = lambda x: 0.5*(x+1)
if k == 1:
    res = e(max(p))
else:
    s = [0]
    s[0] = sum(p[:k])
    for i in range(1, n-k+1):
        s.append(s[i-1] - p[i-1] + p[i+k-1])
    idx = s.index(max(s))
    res = sum([e(p[i]) for i in range(idx, idx+k)])
print(res)