def resolve():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    total = 0
    ans = 0
    for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
    print(ans)
        

if '__main__' == __name__:
    resolve() def resolve():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    total = 0
    ans = 0
    for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
    print(ans)
         resolve N, K = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split K P = list(map(int, input().split())) P list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split total = 0 total 0 ans = 0 ans 0 for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
     i range(N) range N if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
     i < K i K total += (P[i]+1)/2 total (P[i]+1)/2 P[i]+1 P[i] P i 1 2 if i == K-1:
                ans = max(ans, total)
         i == K-1 i K-1 K 1 ans = max(ans, total) ans max(ans, total) max ans total total -= (P[i-K]+1)/2 total (P[i-K]+1)/2 P[i-K]+1 P[i-K] P i-K i K 1 2 total += (P[i]+1)/2 total (P[i]+1)/2 P[i]+1 P[i] P i 1 2 ans = max(ans, total) ans max(ans, total) max ans total print(ans) print ans if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    total = 0
    ans = 0
    for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
    print(ans)
         def resolve():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    total = 0
    ans = 0
    for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
    print(ans)
         resolve
def resolve():
    N, K = list(map(int, input().split()))
    P = list(map(int, input().split()))
    total = 0
    ans = 0
    for i in range(N):
        if i < K:
            total += (P[i]+1)/2
            if i == K-1:
                ans = max(ans, total)
        else:
            total -= (P[i-K]+1)/2
            total += (P[i]+1)/2
            ans = max(ans, total)
    print(ans)
        

if '__main__' == __name__:
    resolve()
