import numpy as np

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

exp=tuple([(int(x)+1)/2 for x in input().split()])

l=np.cumsum(exp)



ans=l[k-1]

for i in range(0,n-k):

  x=l[i+k]-l[i]

  ans=max(ans,x)

print(ans)
def main():

    from itertools import accumulate

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

    *exp, = [(int(x) + 1) / 2 for x in input().split()]

    l = accumulate(exp)

    l = list(l)

    ans = l[k - 1]

    for i in range(0, n - k):

        x = l[i + k] - l[i]

        ans = max(ans, x)

    print(ans)





if __name__ == '__main__':

    main()

import numpy as np

n, k = list(map(int, input().split()))
exp = tuple([(int(x) + 1) / 2 for x in input().split()])
l = np.cumsum(exp)
ans = l[k - 1]
for i in range(0, n - k):
    x = l[i + k] - l[i]
    ans = max(ans, x)
print(ans)

def main():
    from itertools import accumulate

    n, k = list(map(int, input().split()))
    (*exp,) = [(int(x) + 1) / 2 for x in input().split()]
    l = accumulate(exp)
    l = list(l)
    ans = l[k - 1]
    for i in range(0, n - k):
        x = l[i + k] - l[i]
        ans = max(ans, x)
    print(ans)


if __name__ == "__main__":
    main()

-import numpy as np +def main(): +    from itertools import accumulate -n, k = list(map(int, input().split())) -exp = tuple([(int(x) + 1) / 2 for x in input().split()]) -l = np.cumsum(exp) -ans = l[k - 1] -for i in range(0, n - k): -    x = l[i + k] - l[i] -    ans = max(ans, x) -print(ans) +    n, k = list(map(int, input().split())) +    (*exp,) = [(int(x) + 1) / 2 for x in input().split()] +    l = accumulate(exp) +    l = list(l) +    ans = l[k - 1] +    for i in range(0, n - k): +        x = l[i + k] - l[i] +        ans = max(ans, x) +    print(ans) + + +if __name__ == "__main__": +    main()