import sys

input = sys.stdin.readline

from itertools import accumulate



def main():

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

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



    for i in range(N):

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



    p = [0] + list(accumulate(p))



    ans = 0

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

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



    print(ans)



if __name__ == "__main__":

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

# p[i]での出目の期待値

P = [(int(i) + 1) / 2 for i in input().split()]



from itertools import accumulate



P = [0] + list(accumulate(P))



ans = 0

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

    ans = max(ans, P[i + K] - P[i])



print(ans)
import sys

input = sys.stdin.readline
from itertools import accumulate


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


if __name__ == "__main__":
    main()

N, K = list(map(int, input().split()))
# p[i]での出目の期待値
P = [(int(i) + 1) / 2 for i in input().split()]
from itertools import accumulate

P = [0] + list(accumulate(P))
ans = 0
for i in range(N - K + 1):
    ans = max(ans, P[i + K] - P[i])
print(ans)

-import sys - -input = sys.stdin.readline +N, K = list(map(int, input().split())) +# p[i]での出目の期待値 +P = [(int(i) + 1) / 2 for i in input().split()] - -def main(): -    N, K = list(map(int, input().split())) -    p = [int(i) for i in input().split()] -    for i in range(N): -        p[i] = (p[i] + 1) / 2 -    p = [0] + list(accumulate(p)) -    ans = 0 -    for i in range(N - K + 2): -        ans = max(ans, p[i + (K - 1)] - p[i - 1]) -    print(ans) - - -if __name__ == "__main__": -    main() +P = [0] + list(accumulate(P)) +ans = 0 +for i in range(N - K + 1): +    ans = max(ans, P[i + K] - P[i]) +print(ans)