Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = input().split()
ex = [0 for i in range(N)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    

X=N-K+1

for i in range(X):
    newS = 0
    for j in range(K):
        newS += p[i+j]

    if newS > S:
        S = newS

E=(S+K)/2

print(E)



    


Fixed submission:
N, K = map(int, input().split())
p = input().split()
bubun = [0 for i in range(N)]
sums= [0 for i in range(N+K)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    


sums[0] = p[0]
for i in range(N-1):
    sums[i+1] = sums[i] + p[i+1]

for i in range(N):
    if i == 0:
        bubun[i] = sums[K-1]
    else:
        bubun[i] = sums[i+K-1]-sums[i-1]

for i in range(N):

    if bubun[i] > S:
        S = bubun[i]


E=(S+K)/2

print(E)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = input().split()
ex = [0 for i in range(N)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    

X=N-K+1

for i in range(X):
    newS = 0
    for j in range(K):
        newS += p[i+j]

    if newS > S:
        S = newS

E=(S+K)/2

print(E)



    


Fixed submission:
N, K = map(int, input().split())
p = input().split()
bubun = [0 for i in range(N)]
sums= [0 for i in range(N+K)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    


sums[0] = p[0]
for i in range(N-1):
    sums[i+1] = sums[i] + p[i+1]

for i in range(N):
    if i == 0:
        bubun[i] = sums[K-1]
    else:
        bubun[i] = sums[i+K-1]-sums[i-1]

for i in range(N):

    if bubun[i] > S:
        S = bubun[i]


E=(S+K)/2

print(E)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = input().split()
ex = [0 for i in range(N)]
E=0
def expectation(n):
    return (n+1)/2
def ran(n,k,i):
    if i+1>=K and N-(i) >= K:
        return K
    elif i+1 < K:
        return i+1
    else:
        return N-i

for i in range(N):
    p[i] = int(p[i])
    ex[i] = expectation(p[i])

X=N-K+1

for i in range(X):
    newE = 0
    for j in range(K):
        newE += ex[i+j]

    if newE > E:
        E = newE

    
    

print(E)



    


Fixed submission:
N, K = map(int, input().split())
p = input().split()
bubun = [0 for i in range(N)]
sums= [0 for i in range(N+K)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    


sums[0] = p[0]
for i in range(N-1):
    sums[i+1] = sums[i] + p[i+1]

for i in range(N):
    if i == 0:
        bubun[i] = sums[K-1]
    else:
        bubun[i] = sums[i+K-1]-sums[i-1]

for i in range(N):

    if bubun[i] > S:
        S = bubun[i]


E=(S+K)/2

print(E)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = input().split()
ex = [0 for i in range(N)]
E=0
def expectation(n):
    return (n+1)/2


for i in range(N):
    p[i] = int(p[i])
    ex[i] = expectation(p[i])


for i in range(N-K+1):
    newE = 0
    for j in range(K):
        newE += ex[i+j]

    if newE > E:
        E = newE

    

print(E)



    


Fixed submission:
N, K = map(int, input().split())
p = input().split()
bubun = [0 for i in range(N)]
sums= [0 for i in range(N+K)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    


sums[0] = p[0]
for i in range(N-1):
    sums[i+1] = sums[i] + p[i+1]

for i in range(N):
    if i == 0:
        bubun[i] = sums[K-1]
    else:
        bubun[i] = sums[i+K-1]-sums[i-1]

for i in range(N):

    if bubun[i] > S:
        S = bubun[i]


E=(S+K)/2

print(E)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = input().split()
ex = [0 for i in range(N)]
E=0
def expectation(n):
    return (n+1)/2
def ran(n,k,i):
    if i+1>=K and N-(i) >= K:
        return K
    elif i+1 < K:
        return i+1
    else:
        return N-i

for i in range(N):
    p[i] = int(p[i])
    ex[i] = expectation(p[i])


for i in range(N-K+1):
    newE = 0
    for j in range(K):
        newE += ex[i+j]

    if newE > E:
        E = newE

    
    

print(E)



    

Fixed submission:
N, K = map(int, input().split())
p = input().split()
bubun = [0 for i in range(N)]
sums= [0 for i in range(N+K)]
E=0
S=0

for i in range(N):
    p[i] = int(p[i])
    


sums[0] = p[0]
for i in range(N-1):
    sums[i+1] = sums[i] + p[i+1]

for i in range(N):
    if i == 0:
        bubun[i] = sums[K-1]
    else:
        bubun[i] = sums[i+K-1]-sums[i-1]

for i in range(N):

    if bubun[i] > S:
        S = bubun[i]


E=(S+K)/2

print(E)