Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
#p = list(map(int, input().split()))
from sys import stdin
p = [int(x) for x in stdin.readline().rstrip().split()]

m = [0] * n
for i in range(n-k+1):
  m[i] = sum(p[i:i+k])
print((max(m) + k)/2)


Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = [0] * n
for i in range(n-k+1):
  m[i] = sum(p[i:i+k])
print((max(m) + k)/2)


Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = [0] * n
for i in range(n-k+1):
  m[i] = sum(p[i:i+k])
print((max(m) + k)/2)

Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = 0
import numpy as np
p = np.array(p)
for i in range(k):
  m += np.hstack([p[i:], np.zeros(i)])  

print((max(m)+k)/2)

Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = 0
import numpy as np
p = np.array(p)
for i in range(n-k+1):
  m = max(m, sum(p[i:i+k]))
print((m + k)/2)

Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = 0
for i in range(n-k+1):
  m = max(m, sum(p[i:i+k]))
print((m + k)/2)

Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)

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

m = 0
for i in range(n-k+1):
  tmp = sum(p[i:i+k])
  if tmp > m :
    m = tmp
print((m + k)/2)

Fixed submission:
import itertools

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

pa = list(itertools.accumulate([0] + p))

m = 0
for i in range(n-k+1):
  s = pa[i+k] - pa[i]
  if s > m:
    m = s
print((m+k)/2)