Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(nn):
    b = pow(i ** 5 - n, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

Fixed submission:
from decimal import Decimal
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-200,200):
    cheak = i ** 5 - n
    ans = float(pow(Decimal(abs(cheak)), Decimal("0.2")))

    if type(ans) is float:

        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break

Buggy python submission (verdict: Runtime Error):
n = int(input())
nn = int(pow(n,1/5)) + 1
p = sorted(range(nn),reverse = True)
for i in range(nn,0,-1):
    b = pow(n - i, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

Fixed submission:
from decimal import Decimal
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-200,200):
    cheak = i ** 5 - n
    ans = float(pow(Decimal(abs(cheak)), Decimal("0.2")))

    if type(ans) is float:

        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break
Buggy python submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
 
 
def calc(a, b, n):
    return int(math.floor((a * n)/b) - (a * math.floor(n/b)))
 
nn = min(n, b - 1)
print(calc(a, b, nn)

Fixed submission:
import math
a, b, n = map(int, input().split())
 
 
def calc(a, b, n):
    return int(math.floor((a * n)/b) - (a * math.floor(n/b)))
 
if n <= b -1:
  print(calc(a,b,n))
else:
  print(calc(a,b,b-1))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
 
def gcd_list(a,b,c):
    return reduce(math.gcd, [a,b,c])
 
n = int(input())
cnt = 0
for i in range(1,n + 1):
    for j in range(1,n + 1):
        for k in range(1,n + 1):
            
            cnt += gcd_list(i,j,k)
print(cnt)

Fixed submission:
import math
from functools import reduce

def gcd_list(a,b,c):
    return reduce(math.gcd, [a,b,c])

n = int(input())
cnt = 0
for i in range(1,n + 1):
    for j in range(1,n + 1):
        for k in range(1,n + 1):
            
            cnt += gcd_list(i,j,k)
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = str(input())

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

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

cnt = 0
"""
for i in range(n - 2):
    for j in range(i + 1,n -1):
        for k in range(j + 1,n):
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j - i != k - j:
                cnt += 1
                """

for i in range(n -2):
    num = 1
    while i + (num)* 2 <= n -1:
        if s[i] != s[i + num] and s[i] != s[i + 2 * num] and s[i + num] != s[i + 2 * num]:
            cnt += 1
        num += 1
print(s.count("R") * s.count("G") * s.count("B") - cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = str(input())

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

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

cnt = 0
"""
for i in range(n - 2):
    for j in range(i + 1,n -1):
        for k in range(j + 1,n):
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j - i != k - j:
                cnt += 1
                """

for i in range(n -2):
    num = 1
    while i + (num)* 2 <= n -1:
        if s[i] != s[i + num] and s[i] != s[i + 2 * num] and s[i + num] != s[i + 2 * num]:
            cnt += 1
        num += 1
print(s.count("R") * s.count("G") * s.count("B") - cnt)
Buggy python submission (verdict: Runtime Error):
n,k= map(int,input().split())
if n < k:
    print(n % k)
else:

    print(k%(abs(n) % abs(k)))

Fixed submission:
n,k= map(int,input().split())
if n % k == 0:
    print("0")
elif n < k:
    print(min(n % k,abs(n % k - k)))
else:
    print(min(n % k,abs(n % k - k)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(str, (range(1, 10))))
total = a[:]
cnt = 9
while cnt < n:
    new = []
    for i in a:
        if i[-1] == "0":
            new = [(i + "0"), (i + "1")]
            cnt += 2
            if cnt >= n:
                break
        elif i[-1] == "9":
            new = [(i + "8"), (i + "9")]
            cnt += 2
            if cnt >= n:
                break
        else:
            new.append(i + str(int(i[-1]) -1))
            new.append(i + str(int(i[-1])))
            new.append(i + str(int(i[-1]) + 1))
            cnt += 3
            if cnt >= n:
                break
    total += new[:]
    a = new[:]
                
print(total[n-1])

Fixed submission:
n = int(input())
a = list(map(str, (range(1, 10))))
total = a[:]
cnt = 9
while cnt < n:
    new = []
    for i in a:
        if i[-1] == "0":
            new.append(i + "0")
            new.append(i + "1")
            cnt += 2
            if cnt >= n:
                break
        elif i[-1] == "9":
            new.append(i + "8")
            new.append(i + "9")
            cnt += 2
            if cnt >= n:
                break
        else:
            new.append(i + str(int(i[-1]) -1))
            new.append(i + str(int(i[-1])))
            new.append(i + str(int(i[-1]) + 1))
            cnt += 3
            if cnt >= n:
                break
    total += new[:]
    a = new[:]
                
print(total[n-1])
Buggy python submission (verdict: Runtime Error):
import  math

n,m = map(int,input().split())

ans = (math.factorial(n) // (math.factorial(n - 2) * math.factorial(2)))  + (math.factorial(m) // ((math.factorial(m - 2) * math.factorial(2))))
print(ans)

Fixed submission:
import  math

n,m = map(int,input().split())

def ans(a):
    if a<2:
        return 0
    else:
        return math.factorial(a) // (math.factorial(a - 2) * math.factorial(2))

print(int(ans(n) + ans(m)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    l.append(str(input()))
    
l_s = set(l)
max_l = []
max_w = []
l_d = {}
for i in l_s:
    j = l.count(i)
    max_l.append(j)
    l_d[i] = j
    
max_c = max(max_l)

ans = []
for k,v in l_d.items():
    if v == max_c:
        ans.append(k)

ans.sort()
for m in ans:
    print(m)
    

Fixed submission:
n = int(input())
l_d = {}
max_n = 0
max_w = []
for i in range(n):
    n = str(input())
    if n in l_d:
        l_d[n] += 1
        if l_d[n] > max_n:
            max_w = []
            max_w.append(n)
            max_n = l_d[n]
        elif l_d[n] == max_n:
            max_w.append(n)
    else:
        l_d[n] = 1
        if max_n <= 1:
            max_w.append(n)
            
max_w.sort()
for j in max_w:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    l.append(str(input()))
    
l_s = set(l)
max_l = []
max_w = []
l_d = {}
for i in l_s:
    j = l.count(i)
    max_l.append(j)
    l_d[i] = j
    
max_c = max(max_l)

ans = []
for k,v in l_d.items():
    if v == max_c:
        ans.append(k)

ans.sort()
for m in ans:
    print(m)
    

Fixed submission:
n = int(input())
l_d = {}
max_n = 0
max_w = []
for i in range(n):
    n = str(input())
    if n in l_d:
        l_d[n] += 1
        if l_d[n] > max_n:
            max_w = []
            max_w.append(n)
            max_n = l_d[n]
        elif l_d[n] == max_n:
            max_w.append(n)
    else:
        l_d[n] = 1
        if max_n <= 1:
            max_w.append(n)
            
max_w.sort()
for j in max_w:
    print(j)
Buggy python submission (verdict: Time Limit Exceeded):
n ,k = map(int,input().split())
a = list(map(int,input().split()))
max_i = 0
max_d = 0

for i in range(n - k + 1):
    d = 0
    for j in range(k):
        d += a[i + j]
    if d > max_d:
        max_i = i
        max_d = d
ans = 0
for i in range(max_i,max_i + k):
    ans += (1 + a[i])/2
print(ans)  

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

max_d = sum(a[0:k])
max_i = 0
total = sum(a[0:k])


for i in range(1,n - k + 1):
    total = total - a[i - 1] + a[i + k - 1]

    if total > max_d:
        max_d = total
        max_i = i

ans = 0
for i in range(max_i,max_i + k):
    ans += (1 + a[i])/2
print("{:7f}".format(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n ,k = map(int,input().split())
a = list(map(int,input().split()))
 
max_d = 0
 
for i in range(n - k + 1):
    d = 0
    for j in range(k):
        d += (1 + a[i + j])/2
    if d > max_d:
        max_d = d
 
 
print(max_d)

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

max_d = sum(a[0:k])
max_i = 0
total = sum(a[0:k])


for i in range(1,n - k + 1):
    total = total - a[i - 1] + a[i + k - 1]

    if total > max_d:
        max_d = total
        max_i = i

ans = 0
for i in range(max_i,max_i + k):
    ans += (1 + a[i])/2
print("{:7f}".format(ans))

Buggy python submission (verdict: Time Limit Exceeded):

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

max_d = 0

for i in range(n - k + 1):
    d = 0
    for j in range(k):
        d += (1 + a[i + j])/2
    if d > max_d:
        max_d = d


print(max_d)
        

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

max_d = sum(a[0:k])
max_i = 0
total = sum(a[0:k])


for i in range(1,n - k + 1):
    total = total - a[i - 1] + a[i + k - 1]

    if total > max_d:
        max_d = total
        max_i = i

ans = 0
for i in range(max_i,max_i + k):
    ans += (1 + a[i])/2
print("{:7f}".format(ans))
Buggy python submission (verdict: Runtime Error):
n ,m = 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: Runtime Error):
import math

a,b = map(int,input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import math

a,b = map(int,input().split())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a_ = prime_factorize(a)
b_ = prime_factorize(b)

for i in a_:
    if i in b_:
        b_.remove(i)

for j in b_:
    a *= j

print(a)

Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())



def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import math

a,b = map(int,input().split())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a_ = prime_factorize(a)
b_ = prime_factorize(b)

for i in a_:
    if i in b_:
        b_.remove(i)

for j in b_:
    a *= j

print(a)
Buggy python submission (verdict: Runtime Error):
import math

a,b,x = map(int,input().split())

if x > (a*a*b)/2:
    h = (2*x)/(a*a)-b
    kaku = 90 - math.degrees(math.atan(a/(b-h)))
    print(kaku)
else:
    h = (2*x)/(a*b)
    kaku = 90 - math.degrees(math.atan(h/b))
    print(kaku)

Fixed submission:
import math

a,b,x = map(int,input().split())

if x == (a*a*b):
    print("0")
elif x > (a*a*b)/2:
    h = (2*x)/(a*a)-b
    kaku = 90 - math.degrees(math.atan(a/(b-h)))
    print(kaku)
else:
    h = (2*x)/(a*b)
    kaku = 90 - math.degrees(math.atan(h/b))
    print(kaku)

Buggy python submission (verdict: Runtime Error):
import math

a,b,x = map(int,input().split())

if x > (a*a*b)/2:
    h = (2*x)/(a*a)-b
    kaku = 90 - math.degrees(math.atan(a/(b-h)))
    print(kaku)
else:
    h = (2*x)/(a*b)
    kaku = 90 - math.degrees(math.atan(h/b))
    print(kaku)

Fixed submission:
import math

a,b,x = map(int,input().split())

if x == (a*a*b):
    print("0")
elif x > (a*a*b)/2:
    h = (2*x)/(a*a)-b
    kaku = 90 - math.degrees(math.atan(a/(b-h)))
    print(kaku)
else:
    h = (2*x)/(a*b)
    kaku = 90 - math.degrees(math.atan(h/b))
    print(kaku)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())

if a >= 2*b:
    print(a-2*b)
else:
    print("0")


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

if a >= 2*b:
    print(a-2*b)
else:
    print("0")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())

if a >= 2b:
    print(a-2*b)
else:
    print("0")

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

if a >= 2*b:
    print(a-2*b)
else:
    print("0")
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n - 1):
    for j in (i + 1,n):
        ans += d[i] * d[j]
print(ans)


Fixed submission:
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n - 1):
    for j in range(i + 1,n):
        ans += d[i] * d[j]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = []

for i in range(n):
    cnt += 1
    ind = a.index(cnt)
    ans.append(str(ind + 1))

print(" ".join(ans))

Fixed submission:
n = int(input())

if n % 2 == 0:
    print("0.5")
else:
    print(((n - 1)/2 + 1)/n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = []

for i in range(n):
    cnt += 1
    ind = a.index(cnt)
    ans.append(str(ind + 1))

print(" ".join(ans))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = [0] * n

for i in a:
    cnt += 1
    ans[i-1] = str(cnt)

print(" ".join(ans))

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

for i in range(n):
    cnt += 1
    ind = a.index(cnt)
    ans.append(str(ind + 1))

print(" ".join(ans))
    
    

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = [0] * n

for i in a:
    cnt += 1
    ans[i-1] = str(cnt)

print(" ".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
ps = [K]*N

ac = []
for i in range(Q):
    an = int(input())
    ps[an -1] += 1
    for j in range(len(ps)):
        ps[j] = ps[j] - 1
        
    
for k in ps:
    if k > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k, q = map(int, input().split())
n_score = [0] * n
for i in range(q):
    n_score[int(input()) - 1] += 1

for j in n_score:
    if k + j - q > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K,Q = map(int,input().split())
ps = [K]*N
ps = np.array(ps[:])

ac = []
for i in range(Q):
    an = int(input())
    ps[an -1] += 1
    ps = ps - 1
    
for k in ps:
    if k > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k, q = map(int, input().split())
n_score = [0] * n
for i in range(q):
    n_score[int(input()) - 1] += 1

for j in n_score:
    if k + j - q > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):

import numpy as np

N,K,Q = map(int,input().split())
ps = [K]*N
ps = np.array(ps[:])

ac = []
for i in range(Q):
    an = int(input())
    ac.append(an)

for j in ac:
    ps = ps - 1
    ps[j-1] += 1
    
for k in ps:
    if k > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k, q = map(int, input().split())
n_score = [0] * n
for i in range(q):
    n_score[int(input()) - 1] += 1

for j in n_score:
    if k + j - q > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

cnt =0
m =[]
for i in range(n - 1):
	if h[i] >= h[i + 1]:
		cnt += 1
		if i == n - 2:
			m.append(cnt)
	else:
		m.append(cnt)
		cnt = 0

print(max(m))

Fixed submission:
full_num = int(input())     
A = list(map(int, input().split()))  
move = 0
A_result = ""
for i in range(full_num-1):
   if  A[i] >= A[i+1]:
       A_result =A_result+"1"
   else:
       A_result =A_result+"0"
B = list(A_result.split("0"))
C = []
for i in B:
    C.append(len(i))
print(max(C))
Buggy python submission (verdict: Runtime Error):
a,b = int(input())

if a >= b:
  print("10")
else:
  print("0")

Fixed submission:
a,b = map(int,input().split())
 
if a >= b:
  print("10")
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
b = list(map(int,input().split()))
cnt  = 0
ans = 0
while cnt<=x:
  cnt += b[ans]
  ans += 1

print(ans)
  

Fixed submission:

n,x = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
ans = 1
for i in b:
    cnt += i
    if cnt <= x:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
a.pop(max(a))
print(sum(a))

Fixed submission:
a=list(map(int,input().split()))
a.remove(max(a))
print(sum(a))
Buggy python submission (verdict: Runtime Error):
a,p = map(int,input())
print((a * 3 + p)//2)

Fixed submission:
a,p = map(int,input().split())
print((a * 3 + p)//2)
Buggy python submission (verdict: Runtime Error):
r,d,x = map(int,input())

for i in range(10):
  x = r*x - d
  print(r)

Fixed submission:
r,d,x = map(int,input().split())
 
for i in range(10):
  x = r*x - d
  print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int(),input().split())

if b >= a * c:
  print(c)
else:
  print(int(b//a))

Fixed submission:
a, b, c = map(int, input().split())

if b >= a * c:
    print(c)
else:
    print(int(b//a))
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input()))

print(max(a) * 9 + sum(a))


Fixed submission:
a = list(map(int,input().split()))
 
print(max(a) * 9 + sum(a))

Buggy python submission (verdict: Runtime Error):
S = str(input())
T = str(input())
S_d = {}
T_d = {}
for i,j in zip(S,T):
    if i in S_d and j in T_d:
        if S_d[i] == T_d[j]:
            pass
        else:
            print("No")
            break
    else:
        if i in S_d or j in T_d:
            print("No")
            break
        else:
            S_d[i] = S.count(S)
            T_d[j] = T.count(T)
        
else:
    print("Yes")

Fixed submission:
a = list(map(int,input().split()))
 
print(max(a) * 9 + sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
S = str(input())
T = str(input())


for i,j in zip(S,T):
    if S.count(i) == T.count(j):
        pass
    else:
        print("No")
        break
else:
    print("Yes")

Fixed submission:
S = str(input())
T = str(input())
S_d = {}
T_d = {}
trans_d = {}
for i,j in zip(S,T):
    if i in S_d and j in T_d:
        if S_d[i] == T_d[j]:
            if trans_d[i] == j:
                pass
            else:
                print("No")
                break            
        else:
            print("No")
            break
    else:
        if i in S_d or j in T_d:
            print("No")
            break
        else:
            if S.count(S) == T.count(T):
                S_d[i] = S.count(S)
                T_d[j] = T.count(T)
                trans_d[i] = j
            else:
                print("No")
                break
        
else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
S = str(input())
T = str(input())


for i,j in zip(S,T):
    if S.count(i) == T.count(j):
        pass
    else:
        print("No")
        break
else:
    print("Yes")

Fixed submission:
S = str(input())
T = str(input())
S_d = {}
T_d = {}
trans_d = {}
for i,j in zip(S,T):
    if i in S_d and j in T_d:
        if S_d[i] == T_d[j]:
            if trans_d[i] == j:
                pass
            else:
                print("No")
                break            
        else:
            print("No")
            break
    else:
        if i in S_d or j in T_d:
            print("No")
            break
        else:
            if S.count(S) == T.count(T):
                S_d[i] = S.count(S)
                T_d[j] = T.count(T)
                trans_d[i] = j
            else:
                print("No")
                break
        
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lens = list(map(int,input().split()))
items = list(set(lens))
items.sort(reverse = True)

cnt = 0
for j in items:
  k = lens.count(j)
  if k >= 4 and cnt == 0:
    print(j**2)
    break
  elif k >= 2 and cnt == 0:
    cnt = j
  elif k >= 2 and cnt != 0:
    print(cnt * j)
    break
else:
  print(0)

Fixed submission:
import collections
 
n = int(input())
lens = list(map(int,input().split()))
lens = collections.Counter(lens)
lens = sorted(lens.items(), key=lambda x:x[0], reverse = True)
cnt = 0
for j in lens:
  if j[1] >= 4 and cnt == 0:
    print(j[0]**2)
    break
  elif j[1] >= 2 and cnt == 0:
    cnt = j[0]
  elif j[1] >= 2 and cnt != 0:
    print(cnt * j[0])
    break
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lens = list(map(int,input().split()))
items = set[lens]
items = list(items).sort(reverse = True)
cnt = 0
for j in items:
  if j >= 4 and cnt == 0:
    print(j**2)
    break
  elif j >= 2 and cnt == 0:
    cnt = j
  elif j >= 2 and cnt != 0:
    print(cnt * j)
    break
else:
  print(0)

Fixed submission:
import collections
 
n = int(input())
lens = list(map(int,input().split()))
lens = collections.Counter(lens)
lens = sorted(lens.items(), key=lambda x:x[0], reverse = True)
cnt = 0
for j in lens:
  if j[1] >= 4 and cnt == 0:
    print(j[0]**2)
    break
  elif j[1] >= 2 and cnt == 0:
    cnt = j[0]
  elif j[1] >= 2 and cnt != 0:
    print(cnt * j[0])
    break
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lens = list(map(int,input().split()))

lens.sort(reverse = True)
cnt = 0
for i in lens:
  if l.count(i) >= 4 and cnt != 0:
    print(i*2)
    break
  elif l.count(i) >= 2 and cnt == 0:
    cnt = i
  elif l.count(i) >= 2 and cnt != 0:
    print(cnt * i)
    break
else:
  print(0)

Fixed submission:
import collections
 
n = int(input())
lens = list(map(int,input().split()))
lens = collections.Counter(lens)
lens = sorted(lens.items(), key=lambda x:x[0], reverse = True)
cnt = 0
for j in lens:
  if j[1] >= 4 and cnt == 0:
    print(j[0]**2)
    break
  elif j[1] >= 2 and cnt == 0:
    cnt = j[0]
  elif j[1] >= 2 and cnt != 0:
    print(cnt * j[0])
    break
else:
    print(0)