Buggy python submission (verdict: Runtime Error):
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N-3):
  temp=temp-Q[i]+Q[i+K]
  ans=max(ans,temp)
else:
  print(ans)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for a,i in enumerate(range(N-4)):
  temp=temp-Q[i]+Q[i+K]
  ans=max(ans,temp)
else:
  print(ans)


Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
P=list(map(int,input().split()))
P=P.sort(reverse=True)
P=P[:K]
ans=0

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

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

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

for i in range(N-K+1):
  M=max(M,sum(p[i:i+K]))

print((K+M)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K=map(int, input().split())
P=list(map(int, input().split()))
Q=[sum(P[i:i+K]) for i in range(N-K+1)]

print((max(Q)+K)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  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())))
Q=P.copy()

for _ in range(K-1):
  P=P[1:]
  Q=Q[:-1]
  P=P+Q
  
print((max(P)+K)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split())
P=list(map(int, input().split()))
 
ans=0
for i in range(N):
  try:
    ans=max(ans,sum(P[i:i+K]))
  except:
    break
print((ans+K)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split())
P=list(map(int, input().split()))
 
ans=0
for i in range(N):
  try:
    ans=max(ans,sum(P[i:i+K]))
  except:
    break
print((ans+K)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  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())))
 
ans=0
for i in range(N):
  try:
    ans=max(ans,sum(P[i:i+K]))
  except:
    break
print((ans+K)/2)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  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())))
 
P=(P+1)/2
ans=0
for i in range(N):
  try:
    ans=max(ans,sum(P[i:i+K]))
  except:
    break
print(ans)

Fixed submission:
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)