Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
ans = [sum(p[i : i + K]) for i in range(N-K+1)]

print((max(ans) + K) / 2)

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
ans = 0
f = N-K+1
for i in range(f):
    s = sum(p[i : i + K])
    if ans < s:
        ans = s
print((ans + K) / 2)

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
ans = []
f = N-K+1
for i in range(f):
    ans.append(sum(p[i : i + K]))
print((max(ans) + K) / 2)

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = tuple(map(int, input().split()))
ans = []
f = N-K+1
for i in range(f):
    ans.append(sum(p[i : i + K]))
print((max(ans) + K) / 2)

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
ans = []
f = N-K+1
for i in range(f):
    ans.append(sum(p[i : i + K]))
print((max(ans) + K) / 2)

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

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

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)

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

Fixed submission:
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
s = sum(p[0 : K])
ans = sum(p[0 : K])
f = N-K+1
for i in range(1, f):
    s = s - p[i-1] + p[i + K - 1]
    if ans <= s:
        ans = s
print((ans + K) / 2)