Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in array])

cumsum = ary.cumsum()

exv.append(cumsum[K-1])
for i in range(N - K):
    exv.append([cumsum[i+K] - cumsum[i]])
    
print(max(exv)[0])

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in array])

cumsum = ary.cumsum()

exv.append(cumsum[K-1])
for i in range(N - K):
    exv.append([cumsum[i+K] - cumsum[i]])
    
print(max(exv)[0])

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

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

exv = [(1 + array[i]) / 2 for i in range(K)]
max_num = sum(exv)

for i in range(K, N):
    del exv[0]
    exv.append((1 + array[i]) / 2 )
    sum_exv = sum(exv)
    if sum_exv > max_num:
        max_num = sum_exv
print(max_num)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_num = 0

for i in range(N-K+1):
    if sum(array[i:i+K]) > max_num:
        max_num = sum(array[i:i+K])
        max_numbers = array[i:i+K]

exv = 0
ev_dict = {}
for n in max_numbers:
    if n in ev_dict:
        evn += ev_dict[n]
    else :
        ev_dict.setdefault(n, 0)
        ev = (1+n) / 2
        exv += ev
        ev_dict[n] = ev
    
print(exv)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Runtime Error):
def calcExValue(N):
    ev = []
    for i in range(1, N +1):
        ev.append(i * (1/N))
    return(sum(ev))

N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_num = 0

for i in range(N-K+1):
    if sum(array[i:i+K]) > max_num:
        max_num = sum(array[i:i+K])
        max_numbers = array[i:i+K]

exv = 0
ev_dict = {}
for n in max_numbers:
    if n in ev_dict:
        evn += ev_dict[n]
    else :
        ev_dict.setdefault(n, 0)
        ev = calcExValue(n)
        exv += ev
        ev_dict[n] = ev
    
print(exv)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Time Limit Exceeded):
def calcExValue(N):
    ev = []
    for i in range(1, N +1):
        ev.append(i * (1/N))
    return(sum(ev))

N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_num = 0
for i in range(N-K+1):
    if sum(array[i:i+K]) > max_num:
        max_num = sum(array[i:i+K])
        max_numbers = array[i:i+K]

exv = 0
for n in max_numbers:
    exv += calcExValue(n)
    
print(exv)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Time Limit Exceeded):
def calcExValue(N):
    ev = []
    for i in range(1, N +1):
        ev.append(i * (1/N))
    return(sum(ev))

N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_exv = 0

base_evs = [calcExValue(array[i]) for i in range(K)]

max_evs_sum = sum(base_evs)

for i in range(K,N):
    ev = calcExValue(array[i])
    del base_evs[0]
    base_evs.append(ev)
    if sum(base_evs) > max_evs_sum:
        max_evs_sum = sum(base_evs)
    
print(max_evs_sum)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy python submission (verdict: Time Limit Exceeded):
def calcExValue(N):
    ev = []
    for i in range(1, N +1):
        ev.append(i * (1/N))
    return(sum(ev))

def sumEvs(numbers):
    evs = []
    for N in numbers:
        evs.append(calcExValue(N))
    return(sum(evs))

N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_exv = 0
for i in range(N-K+1):
    exv = sumEvs(array[i:i+K])
    if exv > max_exv:
        max_exv = exv
 
print(max_exv)


Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)