Buggy python submission (verdict: Time Limit Exceeded):
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += (j + 1) / 2
    print(res)
resolve_D()

Fixed submission:
import numpy as np
N,K = map(int,input().split())
q = list(map(int,input().split()))
q = np.array(q)
 
p = (q + 1) /2
p = p.tolist()
a = sum(p[:K])
mx = a
 
for i in range(0,N-K):
    a = a - p[i] + p[i+K]
    if a > mx:
        mx = a
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += j * (j + 1) / 2 / j
    print(res)
resolve_D()

Fixed submission:
import numpy as np
N,K = map(int,input().split())
q = list(map(int,input().split()))
q = np.array(q)
 
p = (q + 1) /2
p = p.tolist()
a = sum(p[:K])
mx = a
 
for i in range(0,N-K):
    a = a - p[i] + p[i+K]
    if a > mx:
        mx = a
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += j * (j + 1) / 2 / j
    print(res)
resolve_D()

Fixed submission:
import numpy as np
N,K = map(int,input().split())
q = list(map(int,input().split()))
q = np.array(q)
 
p = (q + 1) /2
p = p.tolist()
a = sum(p[:K])
mx = a
 
for i in range(0,N-K):
    a = a - p[i] + p[i+K]
    if a > mx:
        mx = a
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += sum([i for i in range(1, j+1)]) / j
    print(res)
resolve_D()

Fixed submission:
import numpy as np
N,K = map(int,input().split())
q = list(map(int,input().split()))
q = np.array(q)
 
p = (q + 1) /2
p = p.tolist()
a = sum(p[:K])
mx = a
 
for i in range(0,N-K):
    a = a - p[i] + p[i+K]
    if a > mx:
        mx = a
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += sum([i for i in range(1, j+1)]) / j
    print(res)
resolve_D()

Fixed submission:
import numpy as np
N,K = map(int,input().split())
q = list(map(int,input().split()))
q = np.array(q)
 
p = (q + 1) /2
p = p.tolist()
a = sum(p[:K])
mx = a
 
for i in range(0,N-K):
    a = a - p[i] + p[i+K]
    if a > mx:
        mx = a
print(mx)