Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
for j in range(N-K+1):
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
    if j==(N-K-1):
        break
print(temp_max)

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
temp_max = 0
for i in range(N):
    Px.append((1+P[i])/2)
for j in range(N-K+1):
    temp_num = sum(Px[j:j+K])
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
temp_max = 0
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    temp_num = sum(Px[j:j+K])
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
Pxx = []
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    temp_num = sum(Px[j:j+K])
    Pxx.append(temp_num)
print(max(Pxx))

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
Pxx = []
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    temp_num = sum(Px[j:j+K])
    Pxx.append(temp_num)
print(Pxx)
print(f'{max(Pxx):.12f}')

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
Pxx = []
sumx = 0
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    for k in range(K):
        sumx += Px[j+k]
        Pxx.append(sumx)
    sumx = 0
print(f'{max(Pxx):.12f}')

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
sump=0
P = list(map(int,input().split()))
P.sort(reverse=True)
for i in range(K):
    p = P[i]*(P[i]+1)/(2*P[i])
    sump += p
print(f'{sump:.12f}')


Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
sump=0
P = list(map(int,input().split()))
P.sort(reverse=True)
for i in range(K):
    p = P[i]*(P[i]+1)/(2*P[i])
    sump += p
print(f'{sump:.12f}')

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)