n, k = map(int, input().split())
p = list(map(int, input().split()))
maxI = 0
maxT = 0
t = 0
for i in range(n):
    t += p[i]
    if k <= i:
        t -= p[i-k]
    if maxT < t:
        maxT = t
        maxI = i
ans = 0


def calc(n):
    return n*(n+1)/2/n
    ans = 0
    for i in range(1, n+1):
        ans += i/n
    return ans


for i in range(maxI-k+1, maxI+1):
    #print(i, p[i])
    ans += calc(p[i])
# print(p)
#print(maxT, maxI)
print(ans) 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 maxI = 0 maxI 0 maxT = 0 maxT 0 t = 0 t 0 for i in range(n):
    t += p[i]
    if k <= i:
        t -= p[i-k]
    if maxT < t:
        maxT = t
        maxI = i i range(n) range n t += p[i] t p[i] p i if k <= i:
        t -= p[i-k]
     k <= i k i t -= p[i-k] t p[i-k] p i-k i k if maxT < t:
        maxT = t
        maxI = i maxT < t maxT t maxT = t maxT t maxI = i maxI i ans = 0 ans 0 def calc(n):
    return n*(n+1)/2/n
    ans = 0
    for i in range(1, n+1):
        ans += i/n
    return ans calc return n*(n+1)/2/n n*(n+1)/2/n n*(n+1)/2 n*(n+1) n n+1 n 1 2 n ans = 0 ans 0 for i in range(1, n+1):
        ans += i/n
     i range(1, n+1) range 1 n+1 n 1 ans += i/n ans i/n i n return ans ans n n for i in range(maxI-k+1, maxI+1):
    #print(i, p[i])
    ans += calc(p[i])
# print(p)
#print(maxT, maxI) i range(maxI-k+1, maxI+1) range maxI-k+1 maxI-k maxI k 1 maxI+1 maxI 1 ans += calc(p[i]) ans calc(p[i]) calc p[i] p i print(ans) print ans maxI = 0 0 maxI t += p[i] p[i] t n, k = map(int, input().split()) map(int, input().split()) n def calc(n):
    return n*(n+1)/2/n
    ans = 0
    for i in range(1, n+1):
        ans += i/n
    return ans def calc(n):
    return n*(n+1)/2/n
    ans = 0
    for i in range(1, n+1):
        ans += i/n
    return ans calc ans += calc(p[i]) calc(p[i]) ans k = map(int, input().split()) map(int, input().split()) k t = 0 0 t maxI = i i maxI t -= p[i-k] p[i-k] t p = list(map(int, input().split())) list(map(int, input().split())) p ans = 0 0 ans maxT = t t maxT maxT = 0 0 maxT
n, k = map(int, input().split())
p = list(map(int, input().split()))
maxI = 0
maxT = 0
t = 0
for i in range(n):
    t += p[i]
    if k <= i:
        t -= p[i-k]
    if maxT < t:
        maxT = t
        maxI = i
ans = 0


def calc(n):
    return n*(n+1)/2/n
    ans = 0
    for i in range(1, n+1):
        ans += i/n
    return ans


for i in range(maxI-k+1, maxI+1):
    #print(i, p[i])
    ans += calc(p[i])
# print(p)
#print(maxT, maxI)
print(ans)
