n, k = [int(i) for i in input().split()]

p = [int(i) for i in input().split()]



sum_max = sum(p[0:k])

sum_temp = sum_max



for i in range(n-k):

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

     if sum_temp > sum_max:

         sum_max = sum_temp



s_max = (sum_max + k) / 2



print(s_max)
import sys



readline = sys.stdin.readline

MOD = 10 ** 9 + 7

INF = float('INF')

sys.setrecursionlimit(10 ** 5)





def main():

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

    P = [0] + list(map(int, readline().split()))



    cur = sum(P[:K])

    s_max = 0



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

        cur += P[K + i]

        cur -= P[i]

        s_max = max(s_max, cur)



    print(((s_max + K) / 2))





if __name__ == '__main__':

    main()

n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
sum_max = sum(p[0:k])
sum_temp = sum_max
for i in range(n - k):
    sum_temp = sum_temp - p[i] + p[i + k]
    if sum_temp > sum_max:
        sum_max = sum_temp
s_max = (sum_max + k) / 2
print(s_max)

import sys

readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)


def main():
    N, K = list(map(int, readline().split()))
    P = [0] + list(map(int, readline().split()))
    cur = sum(P[:K])
    s_max = 0
    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)
    print(((s_max + K) / 2))


if __name__ == "__main__":
    main()

-n, k = [int(i) for i in input().split()] -p = [int(i) for i in input().split()] -sum_max = sum(p[0:k]) -sum_temp = sum_max -for i in range(n - k): -    sum_temp = sum_temp - p[i] + p[i + k] -    if sum_temp > sum_max: -        sum_max = sum_temp -s_max = (sum_max + k) / 2 -print(s_max) +import sys + +readline = sys.stdin.readline +MOD = 10**9 + 7 +INF = float("INF") +sys.setrecursionlimit(10**5) + + +def main(): +    N, K = list(map(int, readline().split())) +    P = [0] + list(map(int, readline().split())) +    cur = sum(P[:K]) +    s_max = 0 +    for i in range(N - K + 1): +        cur += P[K + i] +        cur -= P[i] +        s_max = max(s_max, cur) +    print(((s_max + K) / 2)) + + +if __name__ == "__main__": +    main()