N,K = map(int,input().split())
p = list(map(int,input().split()))

l = []
for i in p:
    l.append((1/2*i*(i+1))/i)

s = [0]*len(l)
s[0] = l[0]
for i in range(1,len(l)):
    s[i] = s[i-1]+l[i]

ans = 0
for i in range(K,len(s)):
    ans = max(ans,s[i]-s[i-K])

if N == K:
    print(max(s))
    exit()

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 l = [] l [] for i in p:
    l.append((1/2*i*(i+1))/i) i p l.append((1/2*i*(i+1))/i) l.append l append (1/2*i*(i+1))/i 1/2*i*(i+1) 1/2*i 1/2 1 2 i i+1 i 1 i s = [0]*len(l) s [0]*len(l) [0] 0 len(l) len l s[0] = l[0] s[0] s 0 l[0] l 0 for i in range(1,len(l)):
    s[i] = s[i-1]+l[i] i range(1,len(l)) range 1 len(l) len l s[i] = s[i-1]+l[i] s[i] s i s[i-1]+l[i] s[i-1] s i-1 i 1 l[i] l i ans = 0 ans 0 for i in range(K,len(s)):
    ans = max(ans,s[i]-s[i-K]) i range(K,len(s)) range K len(s) len s ans = max(ans,s[i]-s[i-K]) ans max(ans,s[i]-s[i-K]) max ans s[i]-s[i-K] s[i] s i s[i-K] s i-K i K if N == K:
    print(max(s))
    exit() N == K N K print(max(s)) print max(s) max s exit() exit print(ans) print ans K = map(int,input().split()) map(int,input().split()) K N,K = map(int,input().split()) map(int,input().split()) N p = list(map(int,input().split())) list(map(int,input().split())) p s = [0]*len(l) [0]*len(l) s ans = max(ans,s[i]-s[i-K]) max(ans,s[i]-s[i-K]) ans ans = 0 0 ans l = [] [] l
N,K = map(int,input().split())
p = list(map(int,input().split()))

l = []
for i in p:
    l.append((1/2*i*(i+1))/i)

s = [0]*len(l)
s[0] = l[0]
for i in range(1,len(l)):
    s[i] = s[i-1]+l[i]

ans = 0
for i in range(K,len(s)):
    ans = max(ans,s[i]-s[i-K])

if N == K:
    print(max(s))
    exit()

print(ans)