Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Fixed submission:
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
for i in range(n-k+1):
    if tmp < sum(s[i:i+k]):
        tmp = sum(s[i:i+k])
        kukan = [i,i+k]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Fixed submission:
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s=list(map(int,input().split()))

lambda x:x+1/2
ans=0
tmp=0
for i in range(n-k+1):
    if tmp < sum(s[i:i+k]):
        tmp = sum(s[i:i+k])
        kukan = [i,i+k]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Fixed submission:
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s=list(map(int,input().split()))
e=[0]*n
e_table=[0]*1000
tmp=0
for i in range(1000):
    tmp+=(i+1)
    e_table[i] = tmp/(i+1)


e = list(map(lambda x:e_table[x-1],s))

ans=0

for i in range(n-k+1):
    ans=max(ans,sum(e[i:i+k]))
print(ans)

Fixed submission:
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s=list(map(int,input().split()))
e=[0]*n
e_table=[0]*1000
tmp=0
for i in range(1000):
    tmp+=(i+1)
    e_table[i] = tmp/(i+1)

for i,p in enumerate(s):
    e[i] = e_table[p-1]

ans=0

for i in range(n-k+1):
    ans =max(ans,sum(e[i:i+k]))
print(ans)
    

Fixed submission:
n,k=map(int,input().split())
s=list(map(int,input().split()))

ans=0
tmp=0
tmp2=sum(s[0:k])
kukan=[0,n]
for i in range(n-k):
    tmp2 -= s[i]
    tmp2 += s[k+i]
    if tmp < tmp2:
        tmp = tmp2
        kukan = [i+1,i+k+1]

for i in range(kukan[0],kukan[1]):
    ans += (s[i]+1)/2
    
print(ans)