Buggy python submission (verdict: Runtime Error):
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(+accumulate(expP)) # 0を忘れずに
print(acc)

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = list([0]+accumulate(expP)) # 0を忘れずに
print(acc)

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))

ans2 = list()
for i in range(n - (k-1)):
    ans2.append(P[i:i+k])
ans = 0
ans5 = list()

for i in ans2:
    ans = 0
    for j in i:
        ans += (1+j)/2
    ans5.append(ans)
print(max(ans5))


Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))

ans2 = list()
for i in range(n - (k-1)):
    ans2.append(P[i:i+k])
ans = 0
ans5 = list()

for i in ans2:
    ans = 0
    for j in i:
        for k in range(1, j + 1):
            ans += k / j
    ans5.append(ans)
print(max(ans5))

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))
 
ans4 = list()
for i in range(n - (k-1)):
    ans4.append(sum(P[i:i+k]))
 
am = np.argmax(ans4)
am2 = P[am:am+k]
ans = 0
for i in am2:
    for j in range(1, i + 1):
        ans += j / i
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))

ans4 = list()
ans2 = list()
for i in range(n - (k-1)):
    ans2.append(P[i:i+k])
    ans4.append(sum(P[i:i+k]))

am = np.argmax(ans4)
am2 = P[am:am+k]
ans = 0
for i in am2:
    for j in range(1, i + 1):
        ans += j / i
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))
#n = 10
#k = 4
#P = [17, 13, 13, 12, 15, 20, 10, 13, 17, 11]
ans2 = list()
for i in range(n - (k-1)):
    ans2.append(P[i:i+k])
#print(ans2)

ans3 = list()
for i in ans2:
    ans3.append(sum(i))
#print(ans3)

am = np.argmax(ans3)
#print(am)
am2 = P[am:am+k]
#print(am2)

ans = 0
for i in am2:
    for j in range(1, i + 1):
        ans += j / i
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))
#n = 10
#k = 4
#P = [17, 13, 13, 12, 15, 20, 10, 13, 17, 11]
ans2 = list()
for i in range(n - (k-1)):
    ans2.append(P[i:i+k])
#print(ans2)

ans3 = list()
for i in ans2:
    ans3.append(sum(i))
#print(ans3)

am = np.argmax(ans3)
#print(am)
am2 = P[am:am+k]
#print(am2)

ans = 0
for i in am2:
    for j in range(1, i + 1):
        ans += j / i
print(ans)

Fixed submission:
from itertools import accumulate

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

# 期待値の前計算
expP = [(P[i]+1)/2 for i in range(n)]

# 累積和の計算
acc = [0]+ list(accumulate(expP)) # 0を忘れずに

# 隣接する K 項の和の計算
ans = 0
for i in range(n-k+1):
  ans = max(ans,acc[i+k]-acc[i])
print(ans)