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

dices =[]
dicesSum=[]
for i in range(N-K+1):
    l= ps[i:i+K]
    dices.append(l)
    dicesSum.append(sum(l))


max_value = max(dicesSum)
max_index = dicesSum.index(max_value)

exp=0
for p in dices[max_index]:
    exp += 0.5*p +0.5
print(exp)


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

dicesSum=[]
l1=ps[0:K]
dicesSum.append(sum(l1))

if K==N:
    exp= (K+ dicesSum[0])/2
    print(exp)
else:
    for i in range(1,N-K+1):
        dicesSum.append(dicesSum[i-1]-ps[i-1]+ps[i+K-1])
    max_value = max(dicesSum)
    exp= (K+ max_value)/2
    print(exp)

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

dices =[]
dicesSum=[]
for i in range(N-K+1):
    l= ps[i:i+K]
    dices.append(l)
    dicesSum.append(sum(l))

max_value = max(dicesSum)
max_index = dicesSum.index(max_value)

exp=0
for p in dices[max_index]:
    exp += 0.5*p +0.5
print(exp)


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

dicesSum=[]
l1=ps[0:K]
dicesSum.append(sum(l1))

if K==N:
    exp= (K+ dicesSum[0])/2
    print(exp)
else:
    for i in range(1,N-K+1):
        dicesSum.append(dicesSum[i-1]-ps[i-1]+ps[i+K-1])
    max_value = max(dicesSum)
    exp= (K+ max_value)/2
    print(exp)

Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
n, k = map(int, input().split())
p = list(map(int, input().split()))
m = 0
for i in range(len(p)-k+1):
  s = sum(p[i:i+k])
  if s>m: m=s  
print((m+k)/2)
#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = 0
rs = sum(p[0:k])
ms = rs
for i in range(1, n - k + 1):
  rs = rs - p[i-1] + p[i+k-1]
  if rs > ms:
    s = i
    ms = rs

ans = 0.0
for pp in p[s:s+k]:
  ans += (1+pp)/2
print(ans)

#for i in range(len(p)-k+1):
#  s = sum(p[i:i+k])
#  if s>m: m=s  

#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
n, k = map(int, input().split())
p = list(map(int, input().split()))
c = []
c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
print((max(c)+k)/2)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = 0
rs = sum(p[0:k])
ms = rs
for i in range(1, n - k + 1):
  rs = rs - p[i-1] + p[i+k-1]
  if rs > ms:
    s = i
    ms = rs

ans = 0.0
for pp in p[s:s+k]:
  ans += (1+pp)/2
print(ans)

#for i in range(len(p)-k+1):
#  s = sum(p[i:i+k])
#  if s>m: m=s  

#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
n, k = map(int, input().split())
p = list(map(int, input().split()))
c = []
for i in range(len(p)-k+1):
  c.append(sum(p[i:i+k]))
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
print((max(c)+k)/2)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = 0
rs = sum(p[0:k])
ms = rs
for i in range(1, n - k + 1):
  rs = rs - p[i-1] + p[i+k-1]
  if rs > ms:
    s = i
    ms = rs

ans = 0.0
for pp in p[s:s+k]:
  ans += (1+pp)/2
print(ans)

#for i in range(len(p)-k+1):
#  s = sum(p[i:i+k])
#  if s>m: m=s  

#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
p = list(map(int, input().split()))
pn = np.array(p)
v = np.array([1]*k)
c = np.convolve(pn, v, mode='same')
print((max(c)+k)/2)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = 0
rs = sum(p[0:k])
ms = rs
for i in range(1, n - k + 1):
  rs = rs - p[i-1] + p[i+k-1]
  if rs > ms:
    s = i
    ms = rs

ans = 0.0
for pp in p[s:s+k]:
  ans += (1+pp)/2
print(ans)

#for i in range(len(p)-k+1):
#  s = sum(p[i:i+k])
#  if s>m: m=s  

#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)