Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
l = list(map(int, input().split()))
# 期待値:マス目の総和／マス目の数, マス目の最大値+最小値[1]／2
l = [(i+1)/2 for i in l] # 期待値に変換

# 累積和を取得
from itertools import accumulate
cum = list(accumulate(l))
# 差分を考慮しつつ k個の和をリストする → 最大値が ans
sum_k = []
for j in range(n-k):
    sum_k.append(cum[k+j] - cum[j])

print(max(sum_k))


Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x = 0
y = 0
for i in range(n-k+1):
    a = sum(l[i:i+k])
    if x < a:
        x = a
        y = i
#print(x,y)

z = 0
#for j in range(y,y+k):
#    z += (l[j]+1)/2

print((sum(l[y:y+k]) + k)/2)

Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x = 0
y = 0
for i in range(n-k+1):
    a = sum(l[i:i+k])
    if x < a:
        x = a
        y = i
#print(x,y)

z = 0
#for j in range(y,y+k):
#    z += (l[j]+1)/2

print((sum(l[y:y+k]) + k)/2)

Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x = 0
y = 0
for i in range(n-k+1):
    if x < sum(l[i:i+k]):
        x = sum(l[i:i+k])
        y = i
#print(x,y)

z = 0
#for j in range(y,y+k):
#    z += (l[j]+1)/2

print((sum(l[y:y+k]) + k)/2)

Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x = 0
y = 0
for i in range(n-k+1):
    if x < max(sum(l[i:i+k]),x):
        x = sum(l[i:i+k])
        y = i
#print(x,y)

z = 0
#for j in range(y,y+k):
#    z += (l[j]+1)/2

print((sum(l[y:y+k]) + k)/2)

#print(z)





Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x =0
y = 0
for i in range(n-k+1):
    if x < max(sum(l[i:i+k]),x):
        x = sum(l[i:i+k])
        y = i
#print(x,y)

z = 0
for j in range(y,y+k):
    z += (l[j]+1)/2

print(z)





Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))

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

x =0
y = 0
for i in range(n-k+1):
    if x < max(sum(l[i:i+k]),x):
        x = max(sum(l[i:i+k]),x)
        y = i
#print(x,y)

z = 0
for j in range(y,y+k):
    z += (l[j]+1)/2

print(z)





Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())
l = list(map(int,input().split()))
#print(l)

p = [0] + list(accumulate(l))

#print(p)

q = []
for i in range(n-k+1):
    q.append((p[i+k] - p[i] + k)/2)

print(max(q))