n,k=list(map(int,input().split()))

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

cnt=sum(p[:k])

ans=cnt

for i in range(k,n):

  cnt-=p[i-k]

  cnt+=p[i]

  ans=max(ans,cnt)

print((ans/2+k/2))
n,k=list(map(int,input().split()))

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

x=sum(p[:k])

max_x=x

idx=0

for i in range(k,n):

  x=x+p[i]-p[i-k]

  if max_x<x:

    idx=i-k+1

    max_x=x

ans=0

for i in range(idx,idx+k):

  ans+=(p[i]*(p[i]+1)//2)/p[i]

print(ans)
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
cnt = sum(p[:k])
ans = cnt
for i in range(k, n):
    cnt -= p[i - k]
    cnt += p[i]
    ans = max(ans, cnt)
print((ans / 2 + k / 2))

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
x = sum(p[:k])
max_x = x
idx = 0
for i in range(k, n):
    x = x + p[i] - p[i - k]
    if max_x < x:
        idx = i - k + 1
        max_x = x
ans = 0
for i in range(idx, idx + k):
    ans += (p[i] * (p[i] + 1) // 2) / p[i]
print(ans)

-cnt = sum(p[:k]) -ans = cnt +x = sum(p[:k]) +max_x = x +idx = 0 -    cnt -= p[i - k] -    cnt += p[i] -    ans = max(ans, cnt) -print((ans / 2 + k / 2)) +    x = x + p[i] - p[i - k] +    if max_x < x: +        idx = i - k + 1 +        max_x = x +ans = 0 +for i in range(idx, idx + k): +    ans += (p[i] * (p[i] + 1) // 2) / p[i] +print(ans)