Buggy python submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - k] 
 
print(max(ans))

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))

Buggy python submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1] + 1, nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - k] 
 
print(max(ans))

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])

zeros = [0] * nk[1]

seq4search = zeros + p

for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = sum(seq4search[i - nk[1] + 1:i + 1])

print(max(ans))

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = 0

zeros = [0] * nk[1]

seq4search = zeros + p

for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    if ans < sum(seq4search[i - nk[1] + 1:i + 1]):
        ans = sum(seq4search[i - nk[1] + 1:i + 1])

print(ans)

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))

sumseq = [0] * (nk[0] - nk[1] + 1)
for i in range(nk[0]):
    p[i] = (p[i] + 1) / 2 

for i in range(nk[0] - nk[1] + 1):
    sumseq[i] = sum(p[i:i + nk[1]])


print(max(sumseq))

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int,input().split()))
p = list(map(int,input().split()))

sumseq = [0] * (nk[0] - nk[1] + 1)
for i in range(nk[0]):
    p[i] = (p[i] + 1) / 2 

for i in range(len(sumseq)):
    sumseq[i] = sum(p[i:i + nk[1]])


print(max(sumseq))

Fixed submission:
nk = list(map(int,input().split()))
p = list(map(int,input().split()))
ans = [0] * (nk[0] + nk[1])
 
zeros = [0] * nk[1]
 
seq4search = zeros + p
 
for i in range(nk[1], nk[0] + nk[1]):
    seq4search[i] = (seq4search[i] + 1) / 2
    ans[i] = ans[i-1] + seq4search[i] - seq4search[i - nk[1]] 
 
print(max(ans))