def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans)
resolve() def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans) resolve n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k p = tuple(map(int,input().split())) p tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split (i+1)/2 for i in p for i in p i p for i in p (i+1)/2 i+1 i 1 2 s = [(i+1)/2 for i in p] s [(i+1)/2 for i in p] a = sum(s[:k]) a sum(s[:k]) sum s[:k] s :k k ans = a ans a for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
     i range(1,n-k+1) range 1 n-k+1 n-k n k 1 a = a - s[i-1] + s[k+i-1] a a - s[i-1] + s[k+i-1] a - s[i-1] a s[i-1] s i-1 i 1 s[k+i-1] s k+i-1 k+i k i 1 ans = max(ans,a) ans max(ans,a) max ans a print(ans) print ans resolve() resolve def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans) def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans) resolve
def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans)
resolve()