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

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

p = [0]+p

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

  p[i]=p[i-1]+p[i]

ret = 0

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

  ret = max(p[i+K-1]-p[i-1],ret)

ret = (ret+K)/2

print(ret)
#!/usr/bin python3

# -*- coding: utf-8 -*-



import sys

input = sys.stdin.readline



def main():

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

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

    Et = [0]*(N+1)

    for i in range(N):

        Et[i+1] = Et[i] + (1+P[i])/2

    ret = 0

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

        ret = max(ret, Et[i+K]-Et[i])

    print(ret)



if __name__ == '__main__':

    main()
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
p = [0] + p
for i in range(1, N + 1):
    p[i] = p[i - 1] + p[i]
ret = 0
for i in range(1, N - K + 2):
    ret = max(p[i + K - 1] - p[i - 1], ret)
ret = (ret + K) / 2
print(ret)

#!/usr/bin python3
# -*- coding: utf-8 -*-
import sys

input = sys.stdin.readline


def main():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    Et = [0] * (N + 1)
    for i in range(N):
        Et[i + 1] = Et[i] + (1 + P[i]) / 2
    ret = 0
    for i in range(N - K + 1):
        ret = max(ret, Et[i + K] - Et[i])
    print(ret)


if __name__ == "__main__":
    main()

-N, K = list(map(int, input().split())) -p = list(map(int, input().split())) -p = [0] + p -for i in range(1, N + 1): -    p[i] = p[i - 1] + p[i] -ret = 0 -for i in range(1, N - K + 2): -    ret = max(p[i + K - 1] - p[i - 1], ret) -ret = (ret + K) / 2 -print(ret) +#!/usr/bin python3 +# -*- coding: utf-8 -*- +import sys + +input = sys.stdin.readline + + +def main(): +    N, K = list(map(int, input().split())) +    P = list(map(int, input().split())) +    Et = [0] * (N + 1) +    for i in range(N): +        Et[i + 1] = Et[i] + (1 + P[i]) / 2 +    ret = 0 +    for i in range(N - K + 1): +        ret = max(ret, Et[i + K] - Et[i]) +    print(ret) + + +if __name__ == "__main__": +    main()