Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
for i in range(k,n):
  temp -=nums[i-k]
  temp +=nums[i]
  sum = max(temp, sum)
print((sum_max +k)/2)

Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

sum_max = max([sum(nums[i:i+k]) for i in range(n-k+1)])

print((sum_max +k)/2)


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

sum_max = 0
for i in range(n-k+1):
  sum_max = max(sum_max, sum(nums[i:i+k]))

print((sum_max +k)/2)


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

sum_max = [sum(nums[i:i+k]) for i in range(n-k+1)]

max_e = (max(sum_max) +k)/2

print(max_e)


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

sum_max = 0
for i in range(n):
  if i+k <= n:
    sum_max = max(sum_max, sum(nums[i:i+k]))

max_e = (sum_max +k)/2

print(max_e)


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

e_nums = [(i+1)/2 for i in nums]

max_sum = 0
for i in range(n):
  if i+k <= n:
    max_sum = max(max_sum, sum(e_nums[i:i+k]))

print(max_sum)


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

e_nums = [(i+1)/2 for i in nums]

sum_e = [sum(e_nums[i:i+k]) for i in range(n) if i+k <= n]

print(max(sum_e))


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
nums = list(map(int, input().split()))

e_nums = [(i+1)/2 for i in nums]

sum_e = [sum(e_nums[i:i+k]) for i in range(n) if i+k <= n-1]

print(max(sum_e))


Fixed submission:
n, k = map(int, input().split())
nums = list(map(int, input().split()))
 
sum_max = sum(nums[:k])
temp = sum_max
for i in range(k,n):
  temp -= nums[i-k]
  temp += nums[i]
  sum_max = max(temp, sum_max)
print((sum_max +k)/2)