Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out_ += P[i+K]-P[i]
  if i == 0:
    ans = out_
  else:
    if out_ > ans:
      ans = out_
    else:
      continue
answer = (base+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out_ += P[i+K]-P[i]
  if i == 0:
    ans = out_
  else:
    if out_ > ans:
      ans = out_
    else:
      continue
answer = (base+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out_ += P[i+K]-P[i]
  if i == 0:
    ans = out_
  else:
    if out > ans:
      ans = out_
    else:
      continue
answer = (base+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out = 0
p = P[0:K]
base_ = sum(p)
for i in range(N-K):
  out += P[i+K]-P[i]
  if i == 0:
    ans = out
  else:
    if out > ans:
      ans = out
    else:
      continue
answer = (base_+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out += P[i+K]-P[i]
  if i == 0:
    ans = out
  else:
    if out > ans:
      ans = out
    else:
      continue
answer = (base+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out += P[i+K]-P[i]
  if i == 0:
    ans = out
  else:
    if out > ans:
      ans = out
    else:
      continue
answer = (base+ans+K)/2
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out += P[i+K]-P[i]
  print(out)
  if i == 0:
    ans = out
  else:
    if out > ans:
      ans = out
    else:
      continue
answer = (base+ans+K)/2
print(base, ans)
print(answer)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
for i in range(N-K+1):
  p = P[i:i+K]
  sum_ = (sum(p)+K)/2
  if i == 0:
    ans = sum_
  else:
    if sum_ > ans:
      ans = sum_
    else:
      continue
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
for i in range(N-K+1):
  p = P[i:i+K]
  sum_ = (sum(p)+K)/2
  if i == 0:
    ans = sum_
  else:
    if sum_ > ans:
      ans = sum_
    else:
      continue
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int,input().split()))
for i in range(N-K+1):
  sum_ = 0
  p = P[i:i+K]
  sum_ = (sum(p)+K)/2

  if i == 0:
    ans = sum_
  else:
    if sum_ > ans:
      ans = sum_
    else:
      continue
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int,input().split()))
for i in range(N-K+1):
  sum_ = 0
  for k in range(K):
    num = P[i+k]
    sum_ += num*(num+1)/2/num
  if i == 0:
    ans = sum_
  else:
    if sum_ > ans:
      ans = sum_
    else:
      continue
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)