Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

for i, p_i in enumerate(p):
  p[i] = (1+p_i)/2

e_v = []
for j in range(n-k+1):
  e_v.append(sum(p[j:j+k]))

print(max(e_v))



Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

p = tuple(p)
max_r = 0
max_i = 0
pre = 0
for i in range(n-k+1):
  if pre > p[i+k-1]:
    pre = p[i]
    continue
  r = sum(p[i:i+k])
  pre = p[i]
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

p = tuple(p)
max_r = 0
max_i = 0
pre = 0
for i in range(n-k+1):
  if pre > p[i+k-1]:
    pre = p[i]
    continue
  r = sum(p[i:i+k])
  pre = p[i]
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

p = tuple(p)
max_r = 0
max_i = 0
for i in range(n-k+1):
  r = sum(p[i:i+k])
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

max_r = 0
max_i = 0
for i in range(n-k+1):
  r = sum(p[i:i+k])
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

max_r = 0
max_i = 0
for i in range(n-k+1):
  r = sum(p[i:i+k])
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)

max_e = 0
for i in range(n-k+1):
  e = sum(q[i:i+k])
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)

max_e = 0
for i in range(n-k+1):
  e = sum(q[i:i+k])
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

max_e = 0
for i in range(n-k+1):
  e = 0
  
  for j in range(i, i+k):
    e += (p[j]+1)/2
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, *p = map(int, open(0).read().split())

max_e = 0
for i in range(n-k+1):
  e = 0
  
  for j in range(i, i+k):
    e += (p[j]+1)/2
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def e_val(p_i):
  return (p_i+1)/2

n, k, *p = map(int, open(0).read().split())

max_e = 0
for i in range(n-k+1):
  e = 0
  
  for j in range(i, i+k):
    e += e_val(p[j])
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def e_val(p_i):
  return (p_i+1)/2

n, k, *p = map(int, open(0).read().split())

max_e = 0
for i in range(n-k+1):
  e = 0
  
  for j in range(i, i+k):
    e += e_val(p[j])
  
  if e > max_e:
    max_e = e

print(max_e)

Fixed submission:
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)