Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = [None]*(N-K+1)
for i in range(0, N-K+1):
    ruiseki[i] = sum(P[i:i+K])

ind = np.array(ruiseki).argmax()
temp = P[ind:ind+K]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = [None]*(N-K+1)
for i in range(0, N-K+1):
    ruiseki[i] = sum(P[i:i+K])

ind = np.array(ruiseki).argmax()
temp = P[ind:ind+K]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)

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

kitai = [None]*(1000+1)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i
ans = 0
ans_list=[]
for i in range(0, N-K+1):
    temp = P[i:i+K]
    temp2 = sum(temp)
    if ans < temp2:
        ans = temp2
        ans_list = temp

ans = 0
for al in ans_list:
    ans += kitai[al]
print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
kitai = [(0.5*i*(i+1))/i for i in range(1, 1001)]

ans = 0
ans_list=[]
for i in range(0, N-K+1):
    temp = P[i:i+K]
    temp2 = sum(temp)
    if ans < temp2:
        ans = temp2
        ans_list = temp

ans = 0
for al in ans_list:
    ans += kitai[al-1]
print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)

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

kitai = [None]*(1000+1)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ans = 0
for i in range(0, N-K+1):
    temp = 0
    for j in range(K):
        temp += kitai[P[i+j]]
    if ans < temp:
        ans = temp

print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)

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

kitai = [None]*(1000+1)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ans = 0
for i in range(0, N-K+1):
    temp = 0
    for j in range(K):
        temp += kitai[P[i+j]]
    if ans < temp:
        ans = temp

print(ans)


Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = list(map(int, input().split()))

kitai = [None]*(1001)
for i in range(1, 1001):
    kitai[i] = (0.5*i*(i+1))/i

ruiseki = P.copy()
ruiseki[K-1] = sum(ruiseki[0:K])
for i in range(K, N):
    ruiseki[i] = ruiseki[i-1]+P[i]-P[i-K]

ind = np.array(ruiseki).argmax()
temp = P[ind-K+1:ind+1]
ans = 0
for t in temp:
    ans+=kitai[t]
print(ans)