import sys

def input(): return sys.stdin.readline().rstrip()

from itertools import accumulate

def main():

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

    P=[int(_) for _ in input().split()]

    PP=[0]*n

    for i in range(n):

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

    PP_ac=list(accumulate(PP))

    ans=PP_ac[k-1]

    for i in range(1,n-k+1):

        ans=max(ans,PP_ac[i+k-1]-PP_ac[i-1])

    print(ans)



if __name__=='__main__':

    main()
import sys

def input(): return sys.stdin.readline().rstrip()

from itertools import accumulate

import numpy as np

def main():

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

    P=[int(_) for _ in input().split()]

    P_num=np.array(P)

    PP=(P_num+1)/2

    PP_cum=np.cumsum(PP)

    PP_cum=np.insert(PP_cum,0,0)

    ans=PP_cum[k:]-PP_cum[:n-k+1]

    print((np.max(ans)))



if __name__=='__main__':

    main()
import sys


def input():
    return sys.stdin.readline().rstrip()


from itertools import accumulate


def main():
    n, k = list(map(int, input().split()))
    P = [int(_) for _ in input().split()]
    PP = [0] * n
    for i in range(n):
        PP[i] = (P[i] + 1) / 2
    PP_ac = list(accumulate(PP))
    ans = PP_ac[k - 1]
    for i in range(1, n - k + 1):
        ans = max(ans, PP_ac[i + k - 1] - PP_ac[i - 1])
    print(ans)


if __name__ == "__main__":
    main()

import sys


def input():
    return sys.stdin.readline().rstrip()


from itertools import accumulate
import numpy as np


def main():
    n, k = list(map(int, input().split()))
    P = [int(_) for _ in input().split()]
    P_num = np.array(P)
    PP = (P_num + 1) / 2
    PP_cum = np.cumsum(PP)
    PP_cum = np.insert(PP_cum, 0, 0)
    ans = PP_cum[k:] - PP_cum[: n - k + 1]
    print((np.max(ans)))


if __name__ == "__main__":
    main()

+import numpy as np -    PP = [0] * n -    for i in range(n): -        PP[i] = (P[i] + 1) / 2 -    PP_ac = list(accumulate(PP)) -    ans = PP_ac[k - 1] -    for i in range(1, n - k + 1): -        ans = max(ans, PP_ac[i + k - 1] - PP_ac[i - 1]) -    print(ans) +    P_num = np.array(P) +    PP = (P_num + 1) / 2 +    PP_cum = np.cumsum(PP) +    PP_cum = np.insert(PP_cum, 0, 0) +    ans = PP_cum[k:] - PP_cum[: n - k + 1] +    print((np.max(ans)))