Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0
for i in range(idx+1,idx+1+K):
    mev += (p[i] + 1.0) / 2.0

print(mev)

Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(2000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0
for i in range(idx+1,idx+1+K):
    mev += (p[i] + 1.0) / 2.0

print(mev)

Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(1001)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0
for i in range(idx+1,idx+1+K):
    mev += (p[i] + 1.0) / 2.0

print(mev)

Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

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

mev = 0
idx = 0

for i in range(N-K+1):
    ev = sum(p[i:i+K])

    if ev > mev:
        idx = i
        mev = ev

ev = 0

for i in range(idx, idx+K):
    ev += ((p[i] + 1.0) / 2.0)

print(ev)

Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

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

mev = 0
idx = 0

for i in range(N-K+1):
    ev = sum(p[i:i+K])

    if ev > mev:
        idx = i
        mev = ev

print(sum(map(lambda x: (x+1.0)/2.0, p[idx:idx+K])))



Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

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

mev = 0
idx = 0

for i in range(N-K+1):
    ev = sum(p[i:i+K])

    if ev > mev:
        idx = i
        mev = ev

print(sum(map(lambda x: (x+1.0)/2.0, p[idx:idx+K])))



Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)

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

mev = 0

for i in range(N-K+1):

    ev = sum(map(lambda x: (x+1.0)/2.0, p[i:i+K]))

    if ev > mev:
        mev = ev

print(mev)


Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))

#累積和を前計算
sum_list = [0 for _ in range(300000)]
sum = 0

for i in range(len(p)):
    sum += p[i]
    sum_list[i] = sum

#答えを計算
mev = 0
idx = 0
for i in range(N-K+1):
    ev = sum_list[i+K]-sum_list[i]
    if ev > mev:
        idx = i
        mev = ev

mev = 0.0
if N != K:
    for i in range(idx+1,idx+1+K):
        mev += (p[i] + 1.0) / 2.0

else:
    for i in range(len(p)):
        mev += (p[i] + 1.0) / 2.0

print(mev)