Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

ans = (sum(cnt[x:x+K]) for x in range(N-K+1))
print(reduce(max, ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

ans = [sum(cnt[x:x+K]) for x in range(N-K+1)] #if len(cnt[x:x+K]) == K]
print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

ans = [sum(cnt[x:x+K]) for x in range(N+1) if len(cnt[x:x+K]) == K]
print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K = map(int, input().split())
cnt = np.array([int(x) * 0.5 + 0.5 for x in input().split()])

ans = np.array([sum(cnt[x:y]) for x, y in zip(range(0, N-K+1), range(K, N+1))])
print(ans.max())

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

ans = [sum(cnt[x:y]) for x, y in zip(range(0, N-K+1), range(K, N+1))]
print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

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

cnt = [x * 0.5 + 0.5 for x in p]
ans = [sum(cnt[x:y]) for x, y in zip(range(0, N-K+1), range(K, N+1))]

print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
cnt = list(map(lambda x : x * 0.5 + 0.5, p))

ans = [sum(cnt[x:y]) for x, y in zip(range(0, N-K+1), range(K, N+1))]
print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
cnt = list(map(lambda x : x * 0.5 + 0.5, p))

ans = []
x = 0
y = K
while len(cnt[x:y]) == K:
    ans.append(sum(cnt[x:y]))
    x += 1
    y += 1

print(max(ans))

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
N, K = map(int, input().split())
p = list(map(int, input().split()))

cnt = {}
x = 0
y = K
while len(p[x:y]) == K:
    cnt[x] = sum(p[x:y])
    x += 1
    y += 1

for x, v in cnt.items():
    if v == max(cnt.values()):
        output = p[x:x+K]
        print(sum(list(map(lambda x : x * 0.5 + 0.5, output))))
        sys.exit(0)

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))

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

cnt = {}
x = 0
y = K
while len(p[x:y]) == K:
    cnt[x] = sum(p[x:y])
    x += 1
    y += 1

for x, v in cnt.items():
    if v == max(cnt.values()):
        output = p[x:x+K]

ans = 0
for o in output:
    ans += sum(range(o+1))/o

print(ans)

Fixed submission:
N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))