Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())


Fixed submission:
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([0] + [(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())

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

#t1 = time.time()
N, K = map(int, input().split())
#P_list = [i for i in map(int, input().split())]

def func(a):
	a_list = [i/a for i in range(1, a+1)]
	return sum(a_list)

ALL_dice = [i for i in range(1, 1001)]
ALL_exp = list(map(func, ALL_dice))

#P_exp = list(map(func, P_list))

P_exp = [ALL_exp[i-1] for i in map(int, input().split())]

#A_list = []
#sum_K = 0
#t1 = time.time()
A_list = np.array([sum(P_exp[i:i+K]) for i in range(N-K+1)])
"""
for i in range(N-K+1):
	for j in range(K):
		sum_K += P_exp[i+j]

	A_list.append(sum_K)
	sum_K = 0
"""
print(np.max(A_list))
#print(A_list)
#t2 = time.time()
#print(t2-t1)


Fixed submission:
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([0] + [(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())

Buggy python submission (verdict: Time Limit Exceeded):
#import time 

#t1 = time.time()
N, K = map(int, input().split())
#P_list = [i for i in map(int, input().split())]

def func(a):
	a_list = [i/a for i in range(1, a+1)]
	return sum(a_list)

ALL_dice = [i for i in range(1, 1001)]
ALL_exp = list(map(func, ALL_dice))



#P_exp = list(map(func, P_list))

P_exp = [ALL_exp[i-1] for i in map(int, input().split())]

#A_list = []
#sum_K = 0
#t1 = time.time()
A_list = [sum(P_exp[i:i+K]) for i in range(N-K+1)]
"""
for i in range(N-K+1):
	for j in range(K):
		sum_K += P_exp[i+j]

	A_list.append(sum_K)
	sum_K = 0
"""
print(max(A_list))
#print(A_list)
#t2 = time.time()
#print(t2-t1)


Fixed submission:
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([0] + [(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())

Buggy python submission (verdict: Time Limit Exceeded):
#import time 

#t1 = time.time()
N, K = map(int, input().split())
#P_list = [i for i in map(int, input().split())]

def func(a):
	a_list = [i/a for i in range(1, a+1)]
	return sum(a_list)

ALL_dice = [i for i in range(1, 1001)]
ALL_exp = list(map(func, ALL_dice))



#P_exp = list(map(func, P_list))

P_exp = [ALL_exp[i-1] for i in map(int, input().split())]

A_list = []
sum_K = 0
for i in range(N-K+1):
	for j in range(K):
		sum_K += P_exp[i+j]

	A_list.append(sum_K)
	sum_K = 0

print(max(A_list))
#print(A_list)
#t2 = time.time()
#print(t2-t1)


Fixed submission:
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([0] + [(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P_list = [i for i in map(int, input().split())]

def func(a):
	a_list = [i/a for i in range(1, a+1)]
	return sum(a_list)

P_exp = list(map(func, P_list))

A_list = []
sum_K = 0
for i in range(N-K+1):
	for j in range(K):
		sum_K += P_exp[i+j]

	A_list.append(sum_K)
	sum_K = 0

print(max(A_list))
#print(A_list)


Fixed submission:
import numpy as np

N, K = map(int, input().split())
P_exp = np.array([0] + [(1+i)/2 for i in map(int, input().split())])
E_sum = np.cumsum(P_exp)

print((E_sum[K:]-E_sum[:-K]).max())