Buggy python submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]
    sumx1=sum([j for j in range(1,x1+1)])


    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]
    sumx1=sum([j for j in range(1,x1+1)])


    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]
    sumx1=sum([j for j in range(1,x1+1)])


    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]
    sumx1=sum([j for j in range(1,x1+1)])


    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]



    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]
    sumx1=0
    for j in range(1,x1+1):
        sumx1+=j

    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)-2):
    num+=P[i]



    if maxnum<num:
        maxnum=num
        index=i

    if i>=K:
        num-=P[i-(K-1)]
List=[]

for i in range(K):
    x1=P[index+i]
    sumx1=0
    for j in range(1,x1+1):
        sumx1+=j

    sumx1=sumx1/x1
    List.append(sumx1)


print(sum(List))


Fixed submission:
import math
N,K = map(int,input().split())
P=list(map(int,input().split()))


maxnum=0
index=0
num=0
for i in range(len(P)):
    num+=P[i]
    if maxnum<num:
        maxnum=num
        index=i




    if i>=K-1:
        num-=P[i-(K-1)]


List=[]
for i in range(K):
    x1=P[index-i]

    sumx1=(1+x1)/2
    List.append(sumx1)


print(sum(List))