Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
s = [sum(p[:i]) for i in range(n+1)]
maxim = 0
for i in range(n-k+1):
    if (s[i+k]-s[i]) > maxim:
        maxim = s[i+k]-s[i]
ans = (maxim+k)/2
print(ans)

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
s = [sum(p[:i]) for i in range(n+1)]
maxim = 0
for i in range(n-k+1):
    if (s[i+k]-s[i]) > maxim:
        maxim = s[i+k]-s[i]
ans = (maxim+k)/2
print(ans)

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
e = [(1+p[i])/2 for i in range(n)]
s = [sum(e[:i]) for i in range(n+1)]
ans = 0
for i in range(n-k+1):
    if (s[i+k]-s[i]) > ans:
        ans = s[i+k]-s[i]
print(ans)

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
e = [(1+p[i])/2 for i in range(n)]
s = [sum(e[:i]) for i in range(n+1)]
sk = [s[i+k]-s[i] for i in range(n-k+1)]

print(max(sk))

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Runtime Error):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
s = []
e = []
for i in range(n):
    s.append(sum(p[:i+1]))

for i in range(n-k):
    e.append(s[i+k]-s[i])

ans = (max(e)+k)/2
    


Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Runtime Error):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
maxnum = 0
for i in range(n-k):
    if p[i+k] >= p[i]:
        maxnum = i+k

ans = (sum(p

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
maxim = 0
for i in range(n-k+1):
    if sum(p[i:i+k]) >= maxim:
        maxim = sum(p[i:i+k])

ans = (maxim+k)/2
print(ans)

Fixed submission:
def main():    
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    s = sum(p[:k])
    maxs = s
    for i in range(n-k):
        s = s - p[i] + p[i+k]
        if s > maxs:
            maxs = s
    ans = (maxs+k)/2
    print(ans)
main()