Buggy python submission (verdict: Runtime Error):
N,V = list(map(int,input().split()))
from collections import deque
listA = list(map(int,input().split()))
listB = deque()
max_number = 0
total = 0
for i in range(N-V+1):
    listB.append(sum(listA[i:i+V]))
max_number = listB.index(max(listB))
for i in listA[max_number:max_number+V]:
    total += (1+i) * (i/2) / i
print(total)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Runtime Error):
B,C = list(map(int,input().split()))
n_l = list(map(int,input().split()))
dic = {1:1,2:1.5,3:2,4:2.5,5:3,6:3.5}
A = []
total = 0
for i in range(B-C+1):
    A.append(sum(n_l[i:i+C]))
place = A.index(max(A))
for i in range(C):
    total += dic[n_l[place+i]]
print(total)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
B,C = list(map(int,input().split()))
n_l = list(map(int,input().split()))
A = []
total = 0
for i in range(B-C+1):
    A.append(sum(n_l[i:i+C]))
place = A.index(max(A))
for i in range(C):
    total += n_l[place+i]+1
print(total*0.5)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total = 0
N,K = list(map(int,input().split()))
number_list = list(map(int,input().split()))
a = [sum(number_list[i:i+K]) for i in range(N-K+1)]
max_pattern = a.index(max(a))
print(sum(r * (1+r) / (2 * r) for r in number_list[max_pattern:max_pattern+K]))

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total = 0
N,K = list(map(int,input().split()))
number_list = list(map(int,input().split()))
a = [sum(number_list[i:i+K]) for i in range(N-K+1)]
max_pattern = a.index(max(a))
for r in number_list[max_pattern:max_pattern+K]:
    total += r * (1+r) / (2 * r)
print(total)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total = 0
N,K = list(map(int,input().split()))
number_list = list(map(int,input().split()))
a = [sum(number_list[i:i+K]) for i in range(N-K+1)]
max_pattern = a.index(max(a))
for r in number_list[max_pattern:max_pattern+K]:
    total += r * (1+r) / (2 * r)
print(total)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a = []
total = 0
N,K = list(map(int,input().split()))
number_list = list(map(int,input().split()))
for i in range(N-K+1):
    a.append(sum(number_list[i:i+K]))
b = max(a)
a = list(a)
max_pattern = a.index(b)
for r in number_list[max_pattern:max_pattern+K]:
    total += r * (1+r) / (2*r)
print(total)

Fixed submission:
N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)