Buggy python submission (verdict: Runtime Error):
n, k= map(int,input().split())
ps = list(map(int, input().split()))
    
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (ps[i] + 1)/2
 
    
tmp=0
for i in range(len(res)-k):
    tmp=max(tmp, s[i+k] - s[i])

print("{:.10f}".format(tmp))

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))

Buggy python submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
    
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (ps[i] + 1)/2
 
    
#res = numpy.cumsum(data2)
tmp=0
for i in range(len(res)-k):
    tmp=max(tmp, s[i+k] - s[i])

print("{:.10f}".format(tmp))

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))

Buggy python submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
if k==1:
    ans=(1+pon[pon.index(max(pon))])/2
    print(ans)
    sys.exit()
    
# 数値を倍にする関数
def calc_double(n):
    return (n +1)/2
 
data2 = list(map(calc_double, ps))
res = numpy.cumsum(data2)
tmp=0
for i in range(len(res)-k):
    if res[i+k]-res[i] >=tmp:
        tmp=res[i+k]-res[i]

print(tmp)

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy
import sys
n, k= map(int,input().split())
ps = list(map(int, input().split()))
pon=ps
i=1

if k==1:
    ans=(1+pon[pon.index(max(pon))])/2
    print(ans)
    sys.exit()

for a in range(k-1):
    ps1 = numpy.roll(pon, -i)  # = np.ndarray([ x[1], x[2], ..., x[n-1], x[0] ])
    ps = ps + ps1
    i+=1

    
if not k==1:
    num=ps.tolist().index(max(ps[:-(k-1)]))

ans=0
for a in range(k):
    ans+=(1+pon[num+a])/2
    
print(ans)

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))

Buggy python submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
pon=ps
i=1
for a in range(k-1):
    ps1 = numpy.roll(pon, -i)  # = np.ndarray([ x[1], x[2], ..., x[n-1], x[0] ])
    ps = ps + ps1
    i+=1

    
if not k==1:num=ps.tolist().index(ps[:-(k-1)].max())
ans=0
for a in range(k):
    ans+=sum(range(1,pon[num+a]+1))/pon[num+a]
    
print(ans)

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))