Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    max_value = max(A)
    max_index = A.index(max_value)

    for i in range(N):
        if i != max_index:
            print(max_value)
        else:
            if i == 0:
                print(max(A[1:]))
            elif i == N:
                print(max(A[:N]))
            else:
                print(max(max(A[:i]), max(A[i + 1 :])))

    return


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    max_value = max(A)
    max_index = A.index(max_value)

    for i in range(N):
        if i != max_index:
            print(max_value)
        else:
            if i == 0:
                print(max(A[1:]))
            elif i == N - 1:
                print(max(A[: N - 1]))
            else:
                print(max(max(A[:i]), max(A[i + 1 :])))

    return


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    print(max(A[1:]))

    for i in range(1, N - 1):
        print(max(max(A[:i]), max(A[i + 1 :])))

    print(max(A[:N]))

    return


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    max_value = max(A)
    max_index = A.index(max_value)

    for i in range(N):
        if i != max_index:
            print(max_value)
        else:
            if i == 0:
                print(max(A[1:]))
            elif i == N - 1:
                print(max(A[: N - 1]))
            else:
                print(max(max(A[:i]), max(A[i + 1 :])))

    return


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def make_list(L, R):
    mod_list = list()

    if R - L <= 2019:
        for i in range(L, R):
            for j in range(i + 1, R + 1):
                mod_list.append((i * j) % 2019)
    else:
        for i in range(L, R):
            for j in range(i + 1, i + 2021):
                mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()


Fixed submission:
def make_list(L, R):
    mod_list = list()

    if R - L <= 2019:
        for i in range(L, R):
            for j in range(i + 1, R + 1):
                mod_list.append((i * j) % 2019)
    else:
        for i in range(L, L + 2020):
            for j in range(i + 1, i + 2021):
                mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def make_list(L, R):
    mod_list = list()

    for i in range(L, R):
        for j in range(i + 1, R + 1):
            mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()


Fixed submission:
def make_list(L, R):
    mod_list = list()

    if R - L <= 2019:
        for i in range(L, R):
            for j in range(i + 1, R + 1):
                mod_list.append((i * j) % 2019)
    else:
        for i in range(L, L + 2020):
            for j in range(i + 1, i + 2021):
                mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(nums):
    return reduce(math.gcd, nums)

K = int(input())

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd([i, j, k])

print(ans)

Fixed submission:
import math
from functools import reduce
 
def gcd(nums):
    return reduce(math.gcd, nums)
 
K = int(input())
 
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd([i, j, k])
 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(nums):
    return reduce(math.gcd, nums)

K = int(input())

a = []
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            a.append([i,j,k])

ans = 0
for i in a:
    ans += gcd(i)

print(ans)

Fixed submission:
import math
from functools import reduce
 
def gcd(nums):
    return reduce(math.gcd, nums)
 
K = int(input())
 
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd([i, j, k])
 
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())


if N < K:
    print(N)
else:
    N = abs(N - (N // K + 1) * K)
    if abs(N-K) <= N:
        print(abs(N-K))
    else:
        print(N)

Fixed submission:
A, B, C = map(int, input().split())

A, B = B, A
A, C = C, A

print(A,B,C)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
*A, = map(int, input().split())

A.sort(reverse=True)
total_point = sum(A)

selectable = False

if  total_point * (1 / (4 * M)) =< A[M-1]:
    selectable = True

if selectable:
    print('Yes')
else:
    print('No')


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

A.sort(reverse=True)
total_point = sum(A)

selectable = False

if total_point * (1 / (4 * M)) <= A[M-1]:
    selectable = True

if selectable:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
s = ''
while len(s) < N:
    s += (A * 'b' + B * 'r') 

print(s[:N].count('b'))

Fixed submission:
N, A, B = map(int, input().split())

blue = N // (A + B) * A
rem = N % (A + B)
blue = blue + min(rem, A)

print(blue)

Buggy python submission (verdict: Time Limit Exceeded):
def detect_collor(num, blue_ball, red_ball):
    string = ''
    while len(string) < num:
        for i in range(blue_ball):
            string += 'b'
        for i in range(red_ball):
            string += 'r'
    return string[:num]

nums, blue_balls, red_balls = map(int, input().split())

ans = detect_collor(nums, blue_balls, red_balls)
print(ans.count('b'))

Fixed submission:
N, A, B = map(int, input().split())

blue = N // (A + B) * A
rem = N % (A + B)
blue = blue + min(rem, A)

print(blue)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input())

if N == M:
    print('Yes')

else:
    print('No')

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

if N == M:
    print('Yes')

else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
*A, = map(int, input().split())
ans = []
for i in range(1, N+1):
    ans.append(str(A.index(i)+1))
print(' '.join(ans))

Fixed submission:
N = int(input())
A = dict(zip(map(int, input().split()), [i for i in range(1, N+1)]))

for i in range(1, N + 1):
    print(A[i], end=' ')
Buggy python submission (verdict: Runtime Error):
a = int(input().replace(' ', ''))

count = 1
while count < 100001
    if a = count ** 2:
        print('Yes')
        break
    count += 1

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = (int(item) for item in input().split())
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki / 2 == 0:
    print('Even')
else:
    print('Odd')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki % 2 == 0:
    print('Odd')
else:
    print('Even')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki // 2 == 0:
    print('Odd')
else:
    print('Even')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki / 2 == 0:
    print('Odd')
else:
    print('Even')

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
a = int(input().replace(' ', ''))

count = 1
while count < 100001
    if a == count ** 2:
        print('Yes')
        break
    count += 1

Fixed submission:
a = int(input().replace(' ', ''))

count = 1
while count < a:
    if a == count * count:
        print('Yes')
        exit()
    count += 1
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
a=l[0]
for i in range(1,n):
    a*=l[i]
    if a==0:
        break
if a>10**18:
    print(-1)
else:
    print(a)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
a=l[0]
for i in range(1,n):
    a*=l[i]
    if a>10**18:
        break
if a>10**18 and l.count(0)==0:
    print(-1)
elif l.count(0)>0:
    print(0)
else:
    print(a)
Buggy python submission (verdict: Runtime Error):
t=list(input())
if t[0]=='?' and t[1]=='P':
    t[0]=t[0].replace('?','D')
elif t[0]=='?' and t[1]=='D':
    t[0]=t[0].replace('?','P')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='D' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
if t[-1]=='?' and t[-2]=='P' or t[-2]=='D':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')

Fixed submission:
t=list(input())
if t[0]=='?':
    t[0]=t[0].replace('?','D')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='D' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
if t[-1]=='?':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')

Buggy python submission (verdict: Runtime Error):
t=list(input())
if t[0]=='?' and t[1]=='P':
    t[0]=t[0].replace('?','P')
elif t[0]=='?' and t[1]=='D':
    t[0]=t[0].replace('?','D')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
        t[i+1]=t[i+1].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
if t[-1]=='?' and t[-2]=='P' or t[-2]=='D':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')

Fixed submission:
t=list(input())
if t[0]=='?':
    t[0]=t[0].replace('?','D')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='D' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
if t[-1]=='?':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')
Buggy python submission (verdict: Time Limit Exceeded):
import networkx as nx
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_nodes_from([i for i in range(1,n+1)])

for x in s:
    g.add_edge(x[0],x[1])
di=nx.predecessor(g,source=1)

if len(di)!=n:
    print("No")
    exit()

print("Yes")
for x in range(2,n+1):
    print(di[x][0])


Fixed submission:
N, M = map(int, input().split())
link = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited = [False for i in range(N)]
result = [0] * N
Q = [0]
visited[0] = True
#Qに要素がなくなるまで
while Q:
    #一番上の要素をpop
    v = Q.pop(0)
    for i in link[v]:
        if visited[i] == False:
            visited[i] = True
            result[i] = v
            Q.append(i)
print("Yes")
for i in range(1, N):
    print(result[i] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
link=[[] for i in range(N)]
for i in range(M):
    A,B=map(int,input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited=[False for i in range(N)]
result=[0]*N
Q=[0]
visited[0]=True
while Q:
    v=Q.pop(0)
    for i in link[v]:
        if visited[i]==False:
            visited[i]==True
            result[i]=v
            Q.append(i)
print('Yes')
for i in range(1,N):
    print(result[i]+1)

Fixed submission:
N, M = map(int, input().split())
link = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited = [False for i in range(N)]
result = [0] * N
Q = [0]
visited[0] = True
#Qに要素がなくなるまで
while Q:
    #一番上の要素をpop
    v = Q.pop(0)
    for i in link[v]:
        if visited[i] == False:
            visited[i] = True
            result[i] = v
            Q.append(i)
print("Yes")
for i in range(1, N):
    print(result[i] + 1)

Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
l=[]
while n>0:
    for i in range(n):
        a=list(map(int,input().split()))
        l.append(a)
        if a[i]

Fixed submission:
N, M = map(int, input().split())
link = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited = [False for i in range(N)]
result = [0] * N
Q = [0]
visited[0] = True
#Qに要素がなくなるまで
while Q:
    #一番上の要素をpop
    v = Q.pop(0)
    for i in link[v]:
        if visited[i] == False:
            visited[i] = True
            result[i] = v
            Q.append(i)
print("Yes")
for i in range(1, N):
    print(result[i] + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,n=map(int,input().split())
l=[]
for i in range(n+1):
    ans= math.floor(a*i/b)-a*(math.floor(i/b))
    l.append(ans)
print(max(l))

Fixed submission:
a,b,n=map(int,input().split())
s=0
if b<=n:
    x=b-1
    s=(a*x)//b-a*(x//b)
else:
    x=n
    s=(a*x)//b-a*(x//b)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,n=map(int,input().split())
l=[]
for i in range(n+1):
    ans= math.floor(a*i/b)-a*(math.floor(i/b))
    l.append(ans)
print(max(l))

Fixed submission:
a,b,n=map(int,input().split())
s=0
if b<=n:
    x=b-1
    s=(a*x)//b-a*(x//b)
else:
    x=n
    s=(a*x)//b-a*(x//b)
print(s)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while a>0 or c>0:
    c-=b
    if c<=0:
        print('Yes')
        sys.exit()
    a-=d
    if a<=0:
        print('No')
        sys.exit()

Fixed submission:
import sys
a,b,c,d=map(int,input().split())
while a>0 or c>0:
    c-=b
    if c<=0:
        print('Yes')
        sys.exit()
    a-=d
    if a<=0:
        print('No')
        sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ml=[i for i in range(k+1)]
n=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            if i==j==l:
                continue
            n+=gcd(i,j,l)         
print(n+sum(ml))

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ml=[i for i in range(k+1)]
n=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            if i==j==l:
                continue
            n+=gcd(i,j,l)         
print(n+sum(ml))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k=int(input())
n=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            n+=gcd(i,j,l)         
print(n)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ml=[i for i in range(k+1)]
n=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            if i==j==l:
                continue
            n+=gcd(i,j,l)         
print(n+sum(ml))
Buggy python submission (verdict: Runtime Error):
Npt

Fixed submission:
n = int(input())
s = list(input())

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

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

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)):
        for k in range(j,len(s)):
            if s[i]!=s[j] and s[i]!=s[k] and s[j]!=s[k] and j-i!=k-j:
                ans+=1
print(ans)

Fixed submission:
n = int(input())
s = list(input())

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

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

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)):
        for k in range(j,len(s)):
            if s[i]!=s[j] and s[i]!=s[k] and s[j]!=s[k] and j-i!=k-j:
                ans+=1
print(ans)

Fixed submission:
n = int(input())
s = list(input())

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

for i in range(n):
    for j in range(i, n):
        k = j+(j-i)
        if (k < n) and (s[i] != s[j]) and (s[j] != s[k]) and (s[k] != s[i]):
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
sum1 = sum(l)/(4*m)
for i in range(m):
    if l[i] < sum1:
        print('No')
        sys.exit()
    else:
        l[i] == l[i+1]
print('Yes')

Fixed submission:
import sys
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
sum1 = sum(l)/(4*m)
for i in range(m):
    if l[i] < sum1:
        print('No')
        sys.exit()
print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,k = map(int,input().split())
l = []
a = abs(n-k)
b = abs(a-k)
if n < a:
    print(n)
    sys.exit()
else:
    for i in range(10**100):
        l.append(a)
        l.append(b)
        if l[i]<l[i+1]:
            print(l[i])

Fixed submission:
n, k = map(int, input().split()) 
t = n % k
if (k-t > t):
    print(t)
else:
    print(k-t)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,k = map(int,input().split())
a = abs(n-k)
if n < a:
    print(n)
    sys.exit()
while True:
    a = abs(a-k)
    if n < a:
        print(a)
        break
    else:
        continue

Fixed submission:
n, k = map(int, input().split()) 
t = n % k
if (k-t > t):
    print(t)
else:
    print(k-t)
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
if s[0:(n-1)//2:1]==s[(n-1)//2:0:-1] and s[(n+3)//2:n:1]==s[n:(n+3)//2:-1]  and  s=s[::-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
N = len(S)
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:N+1]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No")
Buggy python submission (verdict: Runtime Error):
l=int(input())
ans=[]
for i in range(1,l):
    for j in range(1,l):
        ans.append(i*j*(l-i-j))
print(max(ans))

Fixed submission:
l=int(input())
a=l/3
print(a*a*a)

Buggy python submission (verdict: Runtime Error):
l=int(input())
ans=[]
for i in range(1,l//2+1):
    for j in range(1,l//2+1):
        ans.append(i*j*(l-i-j))
print(max(ans))

Fixed submission:
l=int(input())
a=l/3
print(a*a*a)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
for i in range(k):
    if a==[]:
        break
    a.remove(a[0])
print(sum(a))

Fixed submission:
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
if k>=len(a):
    print(0)
else:
    print(sum(a[k:]))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(k):
    if a==[]:
        break
    a.remove(max(a))
print(sum(a))

Fixed submission:
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
if k>=len(a):
    print(0)
else:
    print(sum(a[k:]))
Buggy python submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
res = list(permutations(range(1,n+1)))
ans = abs(res.index(p) - res.index(q))
print(ans)

Fixed submission:
from itertools import permutations
 
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = list(permutations(range(1, n + 1)))
print(abs(a.index(p) - a.index(q)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
res = list(permutations(range(1,n+1)))
ans = abs(res.index(p) - res.index(q))
print(ans)

Fixed submission:
from itertools import permutations
 
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = list(permutations(range(1, n + 1)))
print(abs(a.index(p) - a.index(q)))

Buggy python submission (verdict: Runtime Error):
Not found

Fixed submission:
from itertools import permutations
 
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = list(permutations(range(1, n + 1)))
print(abs(a.index(p) - a.index(q)))
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
print(min(k-a,0),min(b-(k-a),)

Fixed submission:
A, B, K = map(int, input().split())
print(max(0, A-K), max(0, B-max(0, K-A)))