Buggy python submission (verdict: Runtime Error):
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

Fixed submission:
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

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):
    ans = max(ans, sum(p[i:i+K]))

ans = (ans + K) / 2    

print(ans)

Fixed submission:
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

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):
    ans = max(ans, sum(p[i:i+K]))

ans = (ans + K) / 2    

print(ans)

Fixed submission:
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

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

p = [(x + 1) / 2 for x in p]

ans = 0
for i in range(N - K + 1):
    ans = max(ans, sum(p[i:i+K]))

print(ans)

Fixed submission:
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
import numpy as np

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

p = (p + 1) / 2

ans = 0
for i in range(N - K + 1):
    ans = max(ans, p[i:i+K].sum())

print(ans)

Fixed submission:
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)