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

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





def mean(value):

    return 0.5 * (value + 1)





res = 0

for l in range(k):

    res += mean(p[l])



cur = res

for l in range(k, n):

    cur += mean(p[l]) - mean(p[l-k])

    res = max(res, cur)

print(res)

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

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



max_mean = 0

for i in range(k):

    max_mean += 0.5 * (p[i] + 1)



cur = max_mean

for l in range(k, n):

    cur += 0.5 * (p[l] - p[l-k])

    max_mean = max(max_mean, cur)



print(max_mean)

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


def mean(value):
    return 0.5 * (value + 1)


res = 0
for l in range(k):
    res += mean(p[l])
cur = res
for l in range(k, n):
    cur += mean(p[l]) - mean(p[l - k])
    res = max(res, cur)
print(res)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
max_mean = 0
for i in range(k):
    max_mean += 0.5 * (p[i] + 1)
cur = max_mean
for l in range(k, n):
    cur += 0.5 * (p[l] - p[l - k])
    max_mean = max(max_mean, cur)
print(max_mean)

- - -def mean(value): -    return 0.5 * (value + 1) - - -res = 0 -for l in range(k): -    res += mean(p[l]) -cur = res +max_mean = 0 +for i in range(k): +    max_mean += 0.5 * (p[i] + 1) +cur = max_mean -    cur += mean(p[l]) - mean(p[l - k]) -    res = max(res, cur) -print(res) +    cur += 0.5 * (p[l] - p[l - k]) +    max_mean = max(max_mean, cur) +print(max_mean)