Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = ''
    for i in range(1, 99):
	    if N <= 26 ** i:
		    N -= 1
		    for j in range(i):
			    ans += chr(ord('a') + N % 26)
			    N //= 26
			break
	else:
		N -= 26 ** i
print(ans[::-1]) 


Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / 26 <1:
        p = [chr(n + 96)]
        break
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))
    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))



Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))

    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))



Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int, input().split()))

ans = 1
list.sort(a, reverse = True)
for i in range(len(a)):
    if 0 in a:
        ans =0
        break

    ans = ans * a[i]
    if ans >10**18:
        break


if ans >10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n=int(input())
a = list(map(int, input().split()))

ans = 1
list.sort(a, reverse = True)
ones = a.count(1)
for i in range(len(a)-ones):
    if 0 in a:
        ans =0
        break
    ans = ans * a[i]
    if ans >10**18:
        break

if ans >10**18:
    print(-1)
else:
    print(ans)

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

ans = 1


for i in range(len(a)):
    if 0 in a:
        ans =0
        break
    ans = ans * a[i]
    if ans >10**18:
        break


if ans >10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n=int(input())
a = list(map(int, input().split()))

ans = 1
list.sort(a, reverse = True)
ones = a.count(1)
for i in range(len(a)-ones):
    if 0 in a:
        ans =0
        break
    ans = ans * a[i]
    if ans >10**18:
        break

if ans >10**18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int, input().split()))
ans = 1


for i in range(len(a)):
    ans = ans * a[i]


if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n=int(input())
a = list(map(int, input().split()))

ans = 1
list.sort(a, reverse = True)
ones = a.count(1)
for i in range(len(a)-ones):
    if 0 in a:
        ans =0
        break
    ans = ans * a[i]
    if ans >10**18:
        break

if ans >10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n=input().split()
a = int(n[0])
b=int(n[1]) *100

ans = a*b

print(ans/100)


Fixed submission:
import math
from decimal import Decimal
n=input().split()
a = int(n[0])
b=Decimal(n[1])
ans = a*b

print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math
n=input().split()
a = int(n[0])*100
b=int(n[1]) *100

ans = a*b

print(ans/100)


Fixed submission:
import math
from decimal import Decimal
n=input().split()
a = int(n[0])
b=Decimal(n[1])
ans = a*b

print(int(ans))
Buggy python submission (verdict: Runtime Error):
import numpy
import copy
N = int(input())
E= list(map(int,input().split()))
ans = [0 for _ in range(N)]
unique = numpy.unique(E)
#for s in range(len(unique)):
#unique = int(unique)
uniqueNum = [0 for _ in range(len(unique))]

uniqueAns = [0 for _ in range(len(unique))]

y =0
for t in range(len(unique)):
    uniqueNum[t] = E.count(unique[t])
for g in range(len(unique)):
    uni = copy.copy(uniqueNum)
    uni[g] = uni[g] -1
    for h in range(len(unique)):
        y = y + uni[h] * (uni[h]-1)/2
    uniqueAns[g] =  y
for k in range(N):
    for w in range(len(uni)):
        if unique[w] == E[k]:
            ans[k] = uniqueAns[w]
            break
for i in range(N):
    print(int(ans[i]))

Fixed submission:
S = input().split()
N = int(S[0])
M = int(S[1])

print(int(N * (N-1)/2 + M * (M-1)/2))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
for j in range(N):
    if not 1 in a:
        count = -1
        break
    if a[j] ==searchNum:
        searchNum += 1
        continue
    else:
        count +=1
print(count)



Fixed submission:
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
if not 1 in a:
    count = -1
else:
    for j in range(N):

        if a[j] ==searchNum:
            searchNum += 1
            continue
        else:
            count +=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
for j in range(N+1):
    if searchNum ==1:
        if not searchNum in a:
            searchNum = N +1
            break
    if not searchNum in a[index:]:
        searchNum -= 1
        break
    else:
        index = a[index:].index(searchNum)
        searchNum += 1
        continue

print(int(N -searchNum))


Fixed submission:
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
if not 1 in a:
    count = -1
else:
    for j in range(N):

        if a[j] ==searchNum:
            searchNum += 1
            continue
        else:
            count +=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
for j in range(N+1):
    if searchNum ==1:
        if not searchNum in a:
            searchNum = N +1
            break
    if not searchNum in a[index:N]:
        searchNum -= 1
        break
    if j + index < N:
        if a[index + j] == searchNum:
            index = index + j
            searchNum += 1
            continue
    else:
        break

print(int(N -searchNum))



Fixed submission:
N = int(input())
a = []
a = list(map(int,input().split()))
index = 0
count = 0
searchNum = 1
if not 1 in a:
    count = -1
else:
    for j in range(N):

        if a[j] ==searchNum:
            searchNum += 1
            continue
        else:
            count +=1
print(count)
Buggy python submission (verdict: Runtime Error):
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
    elif ones <= 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)


Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
n = str(input())
if len(n) < =2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones < 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)


Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
n = str(input())
a = n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)


Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
n = str(input())
a =n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)


Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
n = str(input())
a =int(n[0:-3])
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)


Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n= int(input())
m = np.zeros((3,2))
sum1 = 0
for i in range(n):
    m[i] = list(map(int,input().split()))
for j in range(n-1):
    for k in range(j+1,n):
        sum1 = sum1 + ((m[j][0] - m[k][0])**2 + (m[j][1]-m[k][1])**2)**(1/2)


ans = 0
mul =1
for l in range(n):
    mul *= n-l
ans = (sum1*(2**(n-1)))/mul
print(ans)



Fixed submission:
import numpy as np
n= int(input())
m = np.zeros((n,2))
sum1 = 0
count =0
for i in range(n):
    m[i] = list(map(int,input().split()))
for j in range(n):
    for k in range(j+1,n):
        sum1 = sum1 + ((m[j][0] - m[k][0])**2 + (m[j][1]-m[k][1])**2)**(1/2)
        count +=1

ans = 0

mul =1
for l in range(n):
    mul *= n-l
po =0
if n ==2:
    po = 1
elif n ==3:
    po =2
else:
    for m in range(n):
        po += m

ans = sum1*(n-1)/count
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
count =0
ans=0
n,m = map(int,input().split())
pattern = list(itertools.permutations(range(2), n))
pattern.append([0]*m)
pattern.append([1]*m)

lists =[]
switches = [1]*n
onoff = [0]*m
for i in range(m):
    lists.append(list(map(int,input().split())))
key_value = list(map(int,input().split()))
for l in pattern:
    switches = list(l)
    for j in range(m):
        for k in range(int(lists[j][0])):
            if switches[k] == 1:
                count += 1
        if count %2 == key_value[j]:
            onoff[j] = 1
        else:
            break
    if not 0 in onoff:
        ans += 1

print(ans)













Fixed submission:
import itertools
count =0
ans=0
n,m = map(int,input().split())
num=[0,1]
pattern = list(itertools.product(num, repeat=n))
lists =[]
switches = [1]*n
onoff = [0]*m
for i in range(m):
    lists.append(list(map(int,input().split())))
key_value = list(map(int,input().split()))
for l in pattern:
    switches = list(l)
    onoff = [0]*m
    for j in range(m):
        count=0
        for k in lists[j][1:]:
            if switches[k-1] == 1:
                count += 1
        if count %2 == key_value[j]:
            onoff[j] = 1
        else:
            break
    if not 0 in onoff:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
count =0
ans=0
n,m = map(int,input().split())
pattern = list(itertools.permutations(range(2), n))
pattern.append([0]*m)
pattern.append([1]*m)

lists =[]
switches = [1]*n
onoff = [0]*m
for i in range(m):
    lists.append(list(map(int,input().split())))
key_value = list(map(int,input().split()))
for l in pattern:
    switches = list(l)
    print(switches)
    for j in range(m):
        for k in range(int(lists[j][0])):
            if switches[k] == 1:
                count += 1
        if count %2 == key_value[j]:
            onoff[j] = 1
        else:
            break
    if not 0 in onoff:
        ans += 1

print(ans)













Fixed submission:
import itertools
count =0
ans=0
n,m = map(int,input().split())
num=[0,1]
pattern = list(itertools.product(num, repeat=n))
lists =[]
switches = [1]*n
onoff = [0]*m
for i in range(m):
    lists.append(list(map(int,input().split())))
key_value = list(map(int,input().split()))
for l in pattern:
    switches = list(l)
    onoff = [0]*m
    for j in range(m):
        count=0
        for k in lists[j][1:]:
            if switches[k-1] == 1:
                count += 1
        if count %2 == key_value[j]:
            onoff[j] = 1
        else:
            break
    if not 0 in onoff:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
i =0
ans =0

while i < N:
    a = int(input())
    b = int(input())

    ans += b - a +1
    i += 1
print(ans)

Fixed submission:
N = int(input())
i =0
ans =0

while i < N:
    a = input().split()
    ans += int(a[1]) - int(a[0]) +1
    i = i + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(lis))


Fixed submission:
import numpy as np
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
print(np.lcm.reduce(lis))

Buggy python submission (verdict: Runtime Error):
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(lis))

Fixed submission:
import numpy as np
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
print(np.lcm.reduce(lis))

Buggy python submission (verdict: Runtime Error):
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))

print(lcm(lis))

Fixed submission:
import numpy as np
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
print(np.lcm.reduce(lis))
Buggy python submission (verdict: Runtime Error):
k,n=input().split();
a=input().split();
k=int(k);
n=int(n);
by=0;
for i in range(n):
	a[i]=int(a[i]);
for i in range(n-1):
	if a[i+1]-a[i]>by:
		by=a[i+1]-a[i];
if (k-a[n-1])+a[0]>by :
	by=(k-a[n-1])+a[0];
print(k-by);


Fixed submission:
a=input();
if a[3]==a[2] and a[5]==a[4]:
	print("Yes");
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
import fractions
a,b=input().split()
a=int(a)
b=int(b)
lcm=a*b/fractions.gcd(a,b)
print(int(lcm))

Fixed submission:
a=input()
b=input()
print(6-int(a)-int(b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()

for i in s:
    print(chr((ord(i)-65+n)%26+65),end="")


Fixed submission:
days=['SUN','MON','TUE','WED','THU','FRI','SAT']
in_day=input()
inx=days.index(in_day)
out_day=7-inx
print(out_day)

Buggy python submission (verdict: Runtime Error):
days=['SUN','MON','TUE','WED','THU','FRI','SAT']
in_day=input()
inx=days.index(in_day)
out_day=7-inx
print(days[out_day])


Fixed submission:
days=['SUN','MON','TUE','WED','THU','FRI','SAT']
in_day=input()
inx=days.index(in_day)
out_day=7-inx
print(out_day)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if 0<a<10 and 0<b<10:
  print(a*b)
else:
  print('-1')


Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
if 0<a<10 and 0<b<10:
  print(a*b)
else:
  print('-1')
Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
len=sort(l)
print(len[1]*len[2])

Fixed submission:
l = list(map(int, input().split()))
len=sorted(l)
print(int(len[1]*len[0]/2))

Buggy python submission (verdict: Runtime Error):
len=input().split
sorted(len, reverse=True)
print(len[0]*len[1]/2)

Fixed submission:
l = list(map(int, input().split()))
len=sorted(l)
print(int(len[1]*len[0]/2))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))
gakki = list(map(int,input().split()))

temp1 = gakki[0]
for i in range(1,K):
    temp1 *= gakki[i]

for i in range(N - K):
    temp2 = int(temp1 / gakki[i] * gakki[K + i])
    if temp1 < temp2:
        print("Yes")
    else:
        print("No")
    temp1 = temp2
    


Fixed submission:
N,K = list(map(int,input().split()))
gakki = list(map(int,input().split()))


for i in range(N - K):
    temp1 = gakki[i]
    temp2 = gakki[K + i]
    if temp1 < temp2:
        print("Yes")
    else:
        print("No")
    temp1 = temp2

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

scores = []


temp = gakki[0]
for i in range(1,K):
    temp *= gakki[i]
scores.append(temp)

for i in range(N - K):
    scores.append(int(scores[i] / gakki[i] * gakki[K + i]))
    

for i in range(N - K):
    if scores[i] < scores[i + 1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
N,K = list(map(int,input().split()))
gakki = list(map(int,input().split()))


for i in range(N - K):
    temp1 = gakki[i]
    temp2 = gakki[K + i]
    if temp1 < temp2:
        print("Yes")
    else:
        print("No")
    temp1 = temp2
Buggy python submission (verdict: Runtime Error):
A,B = list(map(int,input().split())
           
print(A * B)

Fixed submission:
A,B = list(map(int,input().split()))
           
print(A * B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

nums = list(map(int,input().split()))

ans = nums[0]

for x in range(N - 1):
    ans = ans * nums[x + 1]


if ans > 1000000000000000000:
    print("-1")
else:
    print(ans)

Fixed submission:
N = int(input())

nums = list(map(int,input().split()))

ans = nums[0]

for i in range(N):
    if nums[i] == 0:
        print("0")
        exit()

for x in range(N - 1):
    ans = ans * nums[x + 1]
    if ans > 1000000000000000000:
        print("-1")
        exit()
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
T_HP,T_Atk,A_HP,A_Atk = map(int,input().split())

Takahashi = [T_HP,T_Atk]
Asakura = [A_HP,A_Atk]

    
while True:    
    Asakura[0] - Takahashi[1]
    if Asakura[0] < 0:
        print("Yes")
        exit()
    
    
    Takahashi[0] - Asakura[1]
    if Takahashi[0] < 0:
        print("No")
        exit()


Fixed submission:
T_HP,T_Atk,A_HP,A_Atk = map(int,input().split())

Takahashi = [T_HP,T_Atk]
Asakura = [A_HP,A_Atk]

    
while True:    
    Asakura[0] -= Takahashi[1]
    if Asakura[0] < 1:
        print("Yes")
        exit()
    
    
    Takahashi[0] -= Asakura[1]
    if Takahashi[0] < 1:
        print("No")
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

count = []

for _ in range(N):
    temp = input()
    if temp in count:
        pass
    else:
        count.append(temp)
        
print(len(count))

Fixed submission:
N = int(input())

count = []

for _ in range(N):
    temp = input()
    count.append(temp)
    
count = set(count)

print(len(count))
Buggy python submission (verdict: Runtime Error):
N,M = input().split()
N = int(N)
M = int(M)

temp = sum(input().split())

if N - temp > -1:
  print(N - temp)
else:
  print("-1")

Fixed submission:
N,M = input().split()
N = int(N)
M = int(M)

temp = sum(list(map(int,input().split())))

if N - temp > -1:
  print(N - temp)
else:
  print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))

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

def calc_e(p):
    temp = 0.5 + 0.5 * p
    return temp

temp_max = 0
temp_i = 0

for i in range(N - K + 1):
    temp = sum(P[i:i+K])
    if temp_max <= temp:
        temp_max = temp
        temp_i = i


temp = 0
temp = calc_e(temp_max // K) * (K - 1) + calc_e(temp_max // K + temp_max % K)
print(temp)

Fixed submission:

N,K = list(map(int,input().split()))
line = list(map(int,input().split()))

temp_num = sum(line[0:K])
temp_max = temp_num

for i in range(N - K):
    temp_num = temp_num - line[i] + line[i + K]
    if temp_num > temp_max:
        temp_max = temp_num


print((temp_max + K) / 2)

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

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

def calc_e(p):
    temp = 0
    for i in range(1, p + 1):
#        temp += i * (1 / p)
        temp = 0.5 + 0.5 * p
    return temp

temp_max = 0
temp_i = 0

for i in range(N - K + 1):
    temp = sum(P[i:i+K])
    if temp_max <= temp:
        temp_max = temp
        temp_i = i


temp = 0
for i in range(temp_i,temp_i + K):
    temp += calc_e(P[i])
print(temp)

Fixed submission:

N,K = list(map(int,input().split()))
line = list(map(int,input().split()))

temp_num = sum(line[0:K])
temp_max = temp_num

for i in range(N - K):
    temp_num = temp_num - line[i] + line[i + K]
    if temp_num > temp_max:
        temp_max = temp_num


print((temp_max + K) / 2)

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

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

def calc_e(p):
    temp = 0
    for i in range(1, p + 1):
        temp += i * (1 / p)
    return temp

temp_max = 0
temp_i = 0

for i in range(N - K + 1):
    temp = sum(P[i:i+K])
    if temp_max <= temp:
        temp_max = temp
        temp_i = i


temp = 0
for i in range(temp_i,temp_i + K):
    temp += calc_e(P[i])
print(temp)

Fixed submission:

N,K = list(map(int,input().split()))
line = list(map(int,input().split()))

temp_num = sum(line[0:K])
temp_max = temp_num

for i in range(N - K):
    temp_num = temp_num - line[i] + line[i + K]
    if temp_num > temp_max:
        temp_max = temp_num


print((temp_max + K) / 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())

p_n = list(input().split())

result = 0
min_tmp = N + 1
for x in range(N):
    if p_n[x] < min_tmp:
        result += 1
    min_tmp = min(min_tmp,p_n[x])

print(result)

Fixed submission:
N = int(input())

p_n = list(map(int,input().split()))

result = 0
min_tmp = N + 1
for x in range(N):
    if p_n[x] < min_tmp:
        result += 1
    min_tmp = min(min_tmp,p_n[x])

print(result)