import sys


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():

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

    current = sum(A[:K])
    ans =(current+K)/2

    for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
    print(ans)



if __name__ == "__main__":
    main() import sys sys def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():

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

    current = sum(A[:K])
    ans =(current+K)/2

    for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
    print(ans) main N,K=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K A=list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split current = sum(A[:K]) current sum(A[:K]) sum A[:K] A :K K ans =(current+K)/2 ans (current+K)/2 current+K current K 2 for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
     i range(1,N-K+1) range 1 N-K+1 N-K N K 1 current = current - A[i-1] + A[i+K-1] current current - A[i-1] + A[i+K-1] current - A[i-1] current A[i-1] A i-1 i 1 A[i+K-1] A i+K-1 i+K i K 1 ans = max(ans, (current+K)/2 ) ans max(ans, (current+K)/2 ) max ans (current+K)/2 current+K current K 2 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():

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

    current = sum(A[:K])
    ans =(current+K)/2

    for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
    print(ans) def main():

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

    current = sum(A[:K])
    ans =(current+K)/2

    for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
    print(ans) main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input
import sys


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():

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

    current = sum(A[:K])
    ans =(current+K)/2

    for i in range(1,N-K+1):
        current = current - A[i-1] + A[i+K-1]
        ans = max(ans, (current+K)/2 )
    print(ans)



if __name__ == "__main__":
    main()
