Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
#lis_exp = list(map(lambda x: (int(x)+1)/2, input().split()))
dp=0
best_i = 0
for i in range(N):
    if sum(lis_p[i:i+K]) >= dp:
        best_i = i
    dp = max(sum(lis_p[i:i+K]), dp)
res = sum(list(map(lambda x: (int(x)+1)/2, lis_p[best_i:best_i+K])))
print(res)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
#lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(lambda x: (int(x)+1)/2, input().split()))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(lambda x: (x+1)/2, lis_p))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(lambda x: (x+1)/2, lis_p))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)

Buggy python submission (verdict: Time Limit Exceeded):
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(lambda x: x*(x+1)/2/x, lis_p))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Fixed submission:
N, K = map(int, input().split())
lis_p = map(int, input().split())
def calc_exp(x):
    return (int(x) + 1)/2
lis_exp = list(map(calc_exp, lis_p))
dp= sum(lis_exp[0:K])
cumKsum = sum(lis_exp[0:K])
for i in range(1, N-K+1):
    cumKsum = cumKsum - lis_exp[i-1] + lis_exp[i+K-1]
    dp = max(cumKsum, dp)
print(dp)