Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])
s=[]

for i in range(N-K):
  k-=p[i]
  k+=p[i+K]
  s.append(k)
    
print((K+max(s))/2)

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)
  
      
if __name__ == '__main__':
    main()      
    
      

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

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


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)
  

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

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


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)
  

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

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

for i in range(N-K+1):
  for k in range(K):
    S+=(1+p[i+k])/2
    if (i+k)==(i+K-1):
      if m<S:
        m=S
      S=0



print(m)

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()

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

for i in range(N-K+1):
  for k in range(K):
    S+=p[i+k]
    if (i+k)==(i+K-1):
      if m<S:
        m=S
        t=i
      S=0

for a in range(K):
  x+=(1+p[t+a])/2

print(x)
  
      

Fixed submission:
def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

if __name__ == '__main__':
    main()