
from itertools import accumulate
def resolve():
    def ev(x):
        return (x*(x+1)//2)/x

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

    E = [0]+[ev(a) for a in A]
    E = list(accumulate(E))
    ans = 0
    for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
    print(ans)

if __name__ == "__main__":
    resolve() from itertools import accumulate def resolve():
    def ev(x):
        return (x*(x+1)//2)/x

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

    E = [0]+[ev(a) for a in A]
    E = list(accumulate(E))
    ans = 0
    for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
    print(ans) resolve def ev(x):
        return (x*(x+1)//2)/x

     ev return (x*(x+1)//2)/x (x*(x+1)//2)/x x*(x+1)//2 x*(x+1) x x+1 x 1 2 x x x 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 ev(a) for a in A for a in A a A for a in A ev(a) ev a E = [0]+[ev(a) for a in A] E [0]+[ev(a) for a in A] [0] 0 [ev(a) for a in A] E = list(accumulate(E)) E list(accumulate(E)) list accumulate(E) accumulate E ans = 0 ans 0 for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
     i range(N-K+1) range N-K+1 N-K N K 1 if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
     ans < E[i+K] - E[i] ans E[i+K] - E[i] E[i+K] E i+K i K E[i] E i ans = E[i + K] - E[i] ans E[i + K] - E[i] E[i + K] E i + K i K E[i] E i print(ans) print ans if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    def ev(x):
        return (x*(x+1)//2)/x

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

    E = [0]+[ev(a) for a in A]
    E = list(accumulate(E))
    ans = 0
    for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
    print(ans) def resolve():
    def ev(x):
        return (x*(x+1)//2)/x

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

    E = [0]+[ev(a) for a in A]
    E = list(accumulate(E))
    ans = 0
    for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
    print(ans) resolve

from itertools import accumulate
def resolve():
    def ev(x):
        return (x*(x+1)//2)/x

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

    E = [0]+[ev(a) for a in A]
    E = list(accumulate(E))
    ans = 0
    for i in range(N-K+1):
        if ans < E[i+K] - E[i]:
            ans = E[i + K] - E[i]
    print(ans)

if __name__ == "__main__":
    resolve()