Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from scipy.signal import lfilter

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = np.array(p_list)
b = np.ones(k)/k
p2 = lfilter(b, 1, p_list)
index = np.argmax(p2)
kitaichi = k/2 + k*p2[index]/2
print(kitaichi)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = [0] + p_list

cum_list = []
p_sum = 0
for p in p_list:
    p_sum += p
    cum_list.append(p_sum)
    
cum_list = np.array(cum_list)
sum_list = cum_list[k:]-cum_list[:-k]
index = np.argmax(sum_list)

kitaichi = k/2 + sum_list[index]/2

print(kitaichi)

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

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = np.array(p_list)
b = np.ones(k)/k
p2 = np.convolve(p_list, b, mode='valid')
index = np.argmax(p2)
kitaichi = k/2 + k*p2[index]/2
print(kitaichi)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = [0] + p_list

cum_list = []
p_sum = 0
for p in p_list:
    p_sum += p
    cum_list.append(p_sum)
    
cum_list = np.array(cum_list)
sum_list = cum_list[k:]-cum_list[:-k]
index = np.argmax(sum_list)

kitaichi = k/2 + sum_list[index]/2

print(kitaichi)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]


for i in range(len(p_list)-k+1):
    sum_temp = sum(p_list[i:i+k])
    if i == 0:
        sum_max = sum_temp
        index = i
    elif sum_temp > sum_max:
        sum_max = sum_temp
        index = i
    

kitaichi = k/2 + sum(p_list[index:index+k])/2
    
print(kitaichi)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = [0] + p_list

cum_list = []
p_sum = 0
for p in p_list:
    p_sum += p
    cum_list.append(p_sum)
    
cum_list = np.array(cum_list)
sum_list = cum_list[k:]-cum_list[:-k]
index = np.argmax(sum_list)

kitaichi = k/2 + sum_list[index]/2

print(kitaichi)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

for i in range(len(p_list)-k+1):
    sum_temp = sum(p_list[i:i+k])
    if i == 0:
        sum_max = sum_temp
        index = i
    elif sum_temp > sum_max:
        sum_max = sum_temp
        index = i
    
kitaichi = 0
for i in range(k):
    temp_index = index + i
    kitaichi += (1+p_list[temp_index])/2
    
print(kitaichi)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = [0] + p_list

cum_list = []
p_sum = 0
for p in p_list:
    p_sum += p
    cum_list.append(p_sum)
    
cum_list = np.array(cum_list)
sum_list = cum_list[k:]-cum_list[:-k]
index = np.argmax(sum_list)

kitaichi = k/2 + sum_list[index]/2

print(kitaichi)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

sum_temp_list = []
for i in range(len(p_list)-k+1):
    sum_temp = sum(p_list[i:i+k])
    sum_temp_list.append(sum_temp)
    
index = sum_temp_list.index(max(sum_temp_list))

kitaichi = 0
for i in range(k):
    temp_index = index + i
    kitaichi += (1+p_list[temp_index])/2
    
print(kitaichi)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
p_list = [int(i) for i in input().split()]

p_list = [0] + p_list

cum_list = []
p_sum = 0
for p in p_list:
    p_sum += p
    cum_list.append(p_sum)
    
cum_list = np.array(cum_list)
sum_list = cum_list[k:]-cum_list[:-k]
index = np.argmax(sum_list)

kitaichi = k/2 + sum_list[index]/2

print(kitaichi)