Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pl = list(map(int, input().split()))
# dp = [0] * n

dp = [(i + 1)/2 for i in pl]
pmax = [0] * (n-k+1)

for i in range(n-k+1):
    pmax[i] = sum(dp[i:i+k])

print(max(pmax))

Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pl = list(map(int, input().split()))
dp = [(i + 1)/2 for i in pl]

pmax = 0
for i in range(n-k+1):
    psum = sum(dp[i:i+k])
    if pmax < psum:
        pmax = psum

print(pmax)


Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pl = list(map(int, input().split()))

def cal_p(x):
    return x*(x+1)/2/x

tmp = []
tmp_sum = []
# ans = 0
for i in range(n):
    tmp. append(cal_p(pl[i]))
    if i >= k:
        tmp_sum.append(sum(tmp[i+1-k:i+1]))

print(max(tmp_sum))


Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
pl = list(map(int, input().split()))

ans = 0

for i in range(n):
    pl[i] = (pl[i]*(pl[i]+1)/2/pl[i])
    if i >= k-1:
        if sum(pl[i-k+1:i+1]) > ans:
            ans = sum(pl[i-k+1:i+1])

print(ans)


Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
pl = list(map(int, input().split()))

tmp = []
ans = 0
for i in range(n):
    tmp.append(pl[i]*(pl[i]+1)/2/pl[i])
    if i >= k-1:
        if sum(tmp[i-k+1:i+1]) > ans:
            ans = sum(tmp[i-k+1:i+1])
print(ans)

Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pl = list(map(int, input().split()))

tmp = []
ans = 0
for i in range(n):
    tmp.append(pl[i]*(pl[i]+1)/2/pl[i])
    if i >= k-1:
        if sum(tmp[i-k+1:i+1]) > ans:
            ans = sum(tmp[i-k+1:i+1])
print(ans)

Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pl = list(map(int, input().split()))

tmp = []
for p in pl:
    tmp.append(p*(p+1)/2/p)

ans = 0
for i in range(n-k+1):
    if sum(tmp[i:i+k]) > ans:
        ans = sum(tmp[i:i+k])

print(ans)


Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pl = list(map(int, input().split()))

tmp = []
for p in pl:
    ii = 0
    for i in range(1, p+1):
        ii += i
    tmp.append(ii/p)

ans = 0
for i in range(n-k+1):
    if sum(tmp[i:i+k]) > ans:
        ans = sum(tmp[i:i+k])

print(ans)


Fixed submission:
n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)