Buggy python submission (verdict: Time Limit Exceeded):

def myAnswer(N:int,K:int,P:list) ->  int:
   ans =[]
   for p in P:
      tmp =(p+1)/2
      ans.append(tmp)
   accum = []
   for i in range(0,N-K+1,1):
      accum.append(sum(ans[i:i+K]))
   # print(accum)
   return max(accum)

def modelAnswer():
   return
def main():
   N,K = map(int,input().split())
   P = list(map(int,input().split()))
   print(myAnswer(N,K,P[:]))
if __name__ == '__main__':
   main()

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

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)

Buggy python submission (verdict: Time Limit Exceeded):
def myAnswer(N:int,K:int,P:list) ->  int:
   l =[]
   for i in range(0,N-K+1,1):
      l.append(sum(P[i:i+K]))
   target = l.index(max(l))
   ans = 0
   for t in range(target,target+K):
      p = P[t]
      ans += ((p * (p + 1)) // 2) / p

   return ans

def modelAnswer():
   return
def main():
   N,K = map(int,input().split())
   P = list(map(int,input().split()))
   print(myAnswer(N,K,P[:]))
if __name__ == '__main__':
   main()

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

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)

Buggy python submission (verdict: Time Limit Exceeded):
def myAnswer(N:int,K:int,P:list) ->  int:
   l =[]
   for i in range(0,N-K+1,1):
      l.append(sum(P[i:i+K]))
   target = l.index(max(l))
   ans = 0
   for t in range(target,target+K):
      total = 0
      for i in range(1,P[t]+1):
         total += i
      ans += total/P[t]

   return ans

def modelAnswer():
   return
def main():
   N,K = map(int,input().split())
   P = list(map(int,input().split()))
   print(myAnswer(N,K,P[:]))
if __name__ == '__main__':
   main()

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

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)

Buggy python submission (verdict: Time Limit Exceeded):
def myAnswer(N:int,K:int,P:list) ->  int:
   l =[]
   for i in range(0,N-K+1,1):
      l.append(sum(P[i:i+K]))
   target = l.index(max(l))
   ans = 0
   for t in range(target,target+K):
      total = 0
      for i in range(1,P[t]+1):
         total += i
      ans += total/P[t]

   return ans

def modelAnswer():
   return
def main():
   N,K = map(int,input().split())
   P = list(map(int,input().split()))
   print(myAnswer(N,K,P[:]))
if __name__ == '__main__':
   main()

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

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)

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


m=0
ml=[]
if(K!=1):
    for i in range(N-K+1):
        tmp=0
        tmpl=[]
        for j in range(i,K+i):
            tmp+=p[j]
            tmpl.append(p[j])
        if(tmp > m):
            m=tmp
            ml=tmpl
else:
    ml=[max(p)]
kitai=0
for pi in ml:
    for i in range(1,pi+1):
        kitai+=i/pi

print(kitai)

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

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)