Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K=map(int, input().split())
Q=list(map(int, input().split()))
P=np.array([Q[i:i+K] for i in range(N-K+1)])

best=(P.sum(axis=1)).max()

"""
best=0

for i in range(N-K+1):
  point=P[i:i+K].sum()
  
  if point>best:
    best=point
"""  
    


print(best/2+K/2)



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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K=map(int, input().split())
Q=input().split()
P=np.array([list(map(int, Q[i:i+K])) for i in range(N-K+1)])

best=(P.sum(axis=1)).max()

"""
best=0

for i in range(N-K+1):
  point=P[i:i+K].sum()
  
  if point>best:
    best=point
"""  
    


print(best/2+K/2)



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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)

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

best=0

for i in range(N-K+1):
  point=P[i:i+K].sum()
  
  if point>best:
    best=point
    
    


print(best/2+K/2)

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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)

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

best=0
bestP=np.array([0]*K)
for i in range(N-K+1):
  if P[i:i+K].sum()>best:
    best=P[i:i+K].sum()
    bestP=P[i:i+K]
    

print(((bestP+1)/2).sum())

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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)

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

best=0
bestP=[0]*K
for i in range(N-K+1):
  if P[i:i+K].sum()>best:
    best=P[i:i+K].sum()
    bestP=P[i:i+K]
    

print(((bestP+1)/2).sum())

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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

N, K=map(int, input().split())
P=list(map(int, input().split()))

best=0
bestP=[0]*K
for i in range(N):
  if sum(P[i:i+K])>best:
    best=sum(P[i:i+K])
    bestP=P[i:i+K]
    

ans=0
for p in bestP:
  ans+=(p+1)/2
print(ans)

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

#n面サイコロの出る目の期待値
def n_mean(n):
  return 0.5*(n+1)

Pmean=list(map(lambda x: n_mean(x), P))
Psum=[0]*N
Psum[0]=Pmean[0]
for i in range(1,N):
  Psum[i]=Psum[i-1]+Pmean[i]
#print(Psum)
ans=0
for i in range(N-K+1):
  if i==0:
    ans=Psum[K-1]
  else:
    #1~6 
    ans=max(ans, (Psum[i+K-1]-Psum[i-1]))
  
print(ans)