import numpy as np

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

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

kitaiti = np.array([(0.5*(p+1)) for p in plist])

ans = 0

val = sum(kitaiti[:K])

ans = max(ans, val)

for i in range(1, N-K+1):

    # print(i-1, i+K)

    val -= kitaiti[i-1]

    val += kitaiti[i+K-1]

    ans = max(ans, val)

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

plist = [((num*(num+1))//2)/num for num in list(map(int, input().split()))]

# print(plist)

ans = 0

for i in range(K):

    ans += plist[i]

_ = ans

for i in range(N-K):

    temp = _

    temp -= plist[i]

    temp += plist[i+K]

    # print(i, i+K, ans, temp)

    ans = max(ans, temp)

    _ = temp

print(ans)
import numpy as np

N, K = list(map(int, input().split()))
plist = list(map(int, input().split()))
kitaiti = np.array([(0.5 * (p + 1)) for p in plist])
ans = 0
val = sum(kitaiti[:K])
ans = max(ans, val)
for i in range(1, N - K + 1):
    # print(i-1, i+K)
    val -= kitaiti[i - 1]
    val += kitaiti[i + K - 1]
    ans = max(ans, val)
print(ans)

N, K = list(map(int, input().split()))
plist = [((num * (num + 1)) // 2) / num for num in list(map(int, input().split()))]
# print(plist)
ans = 0
for i in range(K):
    ans += plist[i]
_ = ans
for i in range(N - K):
    temp = _
    temp -= plist[i]
    temp += plist[i + K]
    # print(i, i+K, ans, temp)
    ans = max(ans, temp)
    _ = temp
print(ans)

-import numpy as np - -plist = list(map(int, input().split())) -kitaiti = np.array([(0.5 * (p + 1)) for p in plist]) +plist = [((num * (num + 1)) // 2) / num for num in list(map(int, input().split()))] +# print(plist) -val = sum(kitaiti[:K]) -ans = max(ans, val) -for i in range(1, N - K + 1): -    # print(i-1, i+K) -    val -= kitaiti[i - 1] -    val += kitaiti[i + K - 1] -    ans = max(ans, val) +for i in range(K): +    ans += plist[i] +_ = ans +for i in range(N - K): +    temp = _ +    temp -= plist[i] +    temp += plist[i + K] +    # print(i, i+K, ans, temp) +    ans = max(ans, temp) +    _ = temp