Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = list(map(int,input().split()))
ans = 0
c = int()
for i in range(N+1):
    c = math.floor(A*i/B)-(A*math.floor(i/B))
    if ans <= c:
        ans  =c
    if ans > c:
        break

print(ans)

Fixed submission:
import math
A,B,N = list(map(int,input().split()))
c = int()
if B-1 > N:
    i = N
else:
    i = B-1
c = math.floor(A*i/B)-(A*math.floor(i/B))

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = list(map(int,input().split()))
ans = 0
c = int()
for i in range(N+1):
    c = math.floor(A*i/B)-(A*math.floor(i/B))
    if ans <= c:
        ans  =c
print(ans)

Fixed submission:
import math
A,B,N = list(map(int,input().split()))
c = int()
if B-1 > N:
    i = N
else:
    i = B-1
c = math.floor(A*i/B)-(A*math.floor(i/B))

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = list(map(int,input().split()))
ans = 0
c = int()
for i in range(N+1):
    c = math.floor(A*i/B)-(A*math.floor(i/B))
    if ans <= c:
        ans  =c
print(ans)

Fixed submission:
import math
A,B,N = list(map(int,input().split()))
c = int()
if B-1 > N:
    i = N
else:
    i = B-1
c = math.floor(A*i/B)-(A*math.floor(i/B))

print(c)
Buggy python submission (verdict: Runtime Error):
ort math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
B = list()
a = int()
b = int()
c = int()
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(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
B = list()
a = int()
b = int()
c = int()
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(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())
B = list()
a = int()
b = int()
c = int()
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(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
B = list()
a = int()
b = int()
c = int()
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(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())
B = list()
a = int()
b = int()
c = int()
ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            A = i,j,k
            B.append(A)
for i in range(len(B)):
    a = B[i][0]
    b = B[i][1]
    c = B[i][2]
    ans += gcd(a,b,c)
print(ans)

Fixed submission:
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
B = list()
a = int()
b = int()
c = int()
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(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())
a = int()
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(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
B = list()
a = int()
b = int()
c = int()
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
N,K= list(map(int,input().split()))
Num = 10*18
while Num > 0:
    if N % K ==0:
        Num = 0
        break
    if Num > abs((N%K)-K):
        Num = abs((N%K)-K)
        N  = Num
        if N < abs((N%K)-K):
            break
print(Num)


Fixed submission:
import math
N,K= list(map(int,input().split()))
a = int(N/K)
a1 = a*K
a2 = (a+1)*K
if N % K ==0:
    Num = 0
else:
    if abs(N%K) < abs((N%K)-K) :
        Num = abs(N%K)
    else:
        Num =  abs((N%K)-K)
    
print(Num)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K= list(map(int,input().split()))
Num = 10*18
while Num > 0:
    if N % K ==0:
        Num = 0
        break
    if Num > abs(N-K):
        Num = abs(N-K)
        N  = Num
        if N < abs(N-K):
            break
print(Num)

Fixed submission:
import math
N,K= list(map(int,input().split()))
a = int(N/K)
a1 = a*K
a2 = (a+1)*K
if N % K ==0:
    Num = 0
else:
    if abs(N%K) < abs((N%K)-K) :
        Num = abs(N%K)
    else:
        Num =  abs((N%K)-K)
    
print(Num)
Buggy python submission (verdict: Runtime Error):
A = input()

if A[0]!=A[1]!=A[2]!=A[4] andA[0]!=A[1]!=A[3]!=A[5] and  A[2]==A[3] and A[4] == A[5]:
    print("Yes")
else:
    print("No")

Fixed submission:
A = input()

if A[2]==A[3] and A[4] == A[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
K,N  =list(map(int,input().split()))
A = list(map(int,input().split()))
C = list()
ans = int()
A.append(K)
A.append(int(0))
B = list(sorted(A))
for i in range(len(B)-1):
    C.append(B[i+1]-B[i])
C.remove(0)
C = sorted(C)
print(C)
for i in range(N-1):
    ans += C[i]
print(ans)

Fixed submission:
K,N  =list(map(int,input().split()))
A = list(map(int,input().split()))
C = list()
ans = int()
B = list(sorted(A))
for i in range(len(B)-1):
    C.append(B[i+1]-B[i])
C.append((K-B[-1])+(B[0]))
C = sorted(C)
for i in range(N-1):
    ans += C[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
import math
a,b,c = list(map(int,Decimal(input().split())))
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
A = Decimal(math.sqrt(a))
B = Decimal(math.sqrt(b))
C = Decimal(math.sqrt(c))
AB = Decimal(A+B)
if AB < C:
    print("Yes")
else:
    print("No")


Fixed submission:
a,b,c = list(map(int,input().split()))
X = c-a-b
if X > 0 and X*X > 4*a*b:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
a,b,c = list(map(int,input().split()))
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
A = a**0.5
B = b**0.5
C = c**0.5
AB = A+B
if AB < C:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c = list(map(int,input().split()))
X = c-a-b
if X > 0 and X*X > 4*a*b:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
a,b,c = list(map(int,input().split()))
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
A = a**0.5
B = b**0.5
C = c**0.5
if AB < C:
    print("Yes")
else:
    print("No")


Fixed submission:
a,b,c = list(map(int,input().split()))
X = c-a-b
if X > 0 and X*X > 4*a*b:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a,b,c = list(map(int,input().split()))
A = math.sqrt(a)
B = math.sqrt(b)
C = math.sqrt(c)
AB = Decimal(A+B)
if AB < C:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c = list(map(int,input().split()))
X = c-a-b
if X > 0 and X*X > 4*a*b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
X = list(map(int,input().split()))

a = mean(X)
print(a)
b = 0
for i in range(N):
    b +=(X[i]-a)**2
print(b)

Fixed submission:
import math
from statistics import mean, median,variance,stdev
N = int(input())
X = list(map(int,input().split()))
a = sum(X)
ave = round(a/N)
b = 0
for i in range(N):
    b +=(X[i]-ave)**2
print(b)
Buggy python submission (verdict: Runtime Error):
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)

if N == Y:
    print("YES")
    
else:
    print("NO")

Fixed submission:
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)
Z = len(M)
if Y == Z:
    print("YES")

else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
i = input()
a,b = map(int, i.split())
c = 1

while a > b:
    a -= b
    c += 1
    else:
      print(c)

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

while(a>b) :
    a -= b
    cnt +=1


print(cnt)
Buggy python submission (verdict: Runtime Error):
i = input()
a,b = list(map(int, i.split()))

if a == b:
  print("Yes")
  
  else:
    print("No")

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

if a>b:
 print("No")
elif a<b:
 print("No")
else:
 print("Yes")

Buggy python submission (verdict: Runtime Error):
a = input()

M,N = map(int,a.split())
if M == N:
  print("Yes")
  
  else:
    print("No")

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

if a>b:
 print("No")
elif a<b:
 print("No")
else:
 print("Yes")

Buggy python submission (verdict: Runtime Error):
a = input()
M,N = map(int,a.spliit())

if M == N:
  print(Yes)

else:
  print(No)


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

if a>b:
 print("No")
elif a<b:
 print("No")
else:
 print("Yes")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
a = 0
if A[0] == 1:
    print(1)
else:
    for i in range(N-1):
        if A[0] 

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
c = P[0]
ans = 1
for i in range(1,N):
    if P[i] < c:
        c = P[i]
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A = []
x,y = map(int,input()A.split())

if 500*x-y >= 0:
  print("Yes")
  
  else:
    print("No")

Fixed submission:
i = input()
x,y = map(int,i.split())

if 500*x-y>=0:
    print("Yes")
else:
        print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
if a = SUN:
  print("7")
elif a = MON:
  print("6")
elif a = TUE:
  print("5")
elif a = WED:
  print("4")
elif a = THU:
  print("3")
elif a = FRI:
  print("2")
else:
  print("1")

Fixed submission:
a = input()
if a == "SUN":
  print("7")
elif a == "MON":
  print("6")
elif a == "TUE":
  print("5")
elif a == "WED":
  print("4")
elif a == "THU":
  print("3")
elif a == "FRI":
  print("2")
else:
  print("1")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))

Fixed submission:
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))+1):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))

Fixed submission:
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))+1):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list()
for i in range(1,N+1):
    B.append(A.index(i)+1)
print(' '.join(map(str,B)))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    B.append(A.index(i)+1)
print(' '.join(map(str,B)))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    B.append(A.index(i)+1)
print(' '.join(map(int,B)))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list()
for i in range(1,N+1):
    B.append(A.index(i)+1)
print(' '.join(map(str,B)))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list()
for i in range(1,N+1):
    B.append(A.index(i)+1)
print(' '.join(map(str,B)))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))

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

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))
Buggy python submission (verdict: Runtime Error):
S = input()
if S == Sunny:
  print("Cloudy")
elif S ==  Cloudy:
  print("Rainy")
else:
  print("Sunny")

Fixed submission:
S = input()
if S == "Sunny":
  print("Cloudy")
elif S ==  "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
if B < A:
    print("0")
elif B ==A:
    print("1")
else:
    while ans < B:
        ans += A
        ans -= 1
        c += 1
    print(c)

Fixed submission:
import math
A,B  = list(map(int,input().split()))
ans  = 1
c = 0
if B ==1:
    print("0")
elif B <= A:
    print("1")
else:
    while ans < B:
        ans += A-1
        c += 1
    print(c)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

if b <3200:
  print("red")
else:
  print(a)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int,input().split()))
S = list(str(input()))
S[a+1] = str.lower(S[a+1])
S = "".join(map(str,S))
print(S)

Fixed submission:
a, b = list(map(int,input().split()))
S = list(str(input()))
S[b-1] = str.lower(S[b-1])
S = "".join(map(str,S))
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))
print(N)
print(K)
per = 0
def f(x,y):
    count = 0
    while (x <= y):
        x = 2*x
        count += 1
    return count

for i in range(N):
    b = int(f(i,K))
    per += (1/N)((1/2)**b)
    print(per)
print(per)

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

def f(x,y):
    count = 0
    while (x < y):
        x = 2*x
        count += 1
    return count

for i in range(N):
    b = int(f(i+1,K))
    per += (1/N)*((1/2)**b)
print(per)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))
print(N)
print(K)
per = 0
def f(x,y):
    while x < y:
        x = 2*x
    return x

for i in range(N):
    a = int(f(i,K))
    per += (1/N)((1/2)**a)
print(per)

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

def f(x,y):
    count = 0
    while (x < y):
        x = 2*x
        count += 1
    return count

for i in range(N):
    b = int(f(i+1,K))
    per += (1/N)*((1/2)**b)
print(per)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list(set(A))
x = int()
y = int()
count = 0 
for i in range(len(B)):
  x = B[i]
  y = 0
  y += A.count(x)
  y += A.count(x+1)
  y += A.count(x-1)
  if count <= y:
    count = y
print(count)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0]*(10**6)
c = int()
ans = int(0)
for i in range(len(A)):
  B[A[i]] += 1

for i in range(1,len(B)-2):
  c = 0
  c += B[i-1]
  c += B[i]
  c += B[i+1]
  if ans <= c:
    ans = c
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = sorted(A)
x = int()
y = int()
count = 0 
for i in range(len(B)):
  x = B[i]
  y = 0
  y += A.count(x)
  y += A.count(x+1)
  y += A.count(x-1)
  if count <= y:
    count = y
print(count)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0]*(10**6)
c = int()
ans = int(0)
for i in range(len(A)):
  B[A[i]] += 1

for i in range(1,len(B)-2):
  c = 0
  c += B[i-1]
  c += B[i]
  c += B[i+1]
  if ans <= c:
    ans = c
print(ans)
Buggy python submission (verdict: Runtime Error):
M = int(input())
A = list(map(int,input().split()))
B = [0]*(M+1)
C = [0]*2
D = [0]*2

for i in range(len(A)):
	B[ A[i] ] += 1 # カウント

for i in range(len(B)):
	# 一個しかなかったら条件を満たさないのでするー
	if B[i] < 2: 
        continue

	# 2個以上あれば長方形にスタック
	C.append(i)

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: 
        D.append(i)
# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))

Fixed submission:
M = int(input())
A = list(map(int,input().split()))
B = {}
C = [0]*2
D = [0]*2

for i in range(len(A)):
	a = str(A[i])
	# 存在したらカウントアップ
	if (a in B): B[ str(A[i]) ] += 1 # カウント
	# 存在しなかったら 1 で初期化
	else: B[ str(A[i]) ] = 1 # カウント
	# {"1":2, "2":3, "3":1}

for i in B:
	# 一個しかなかったら条件を満たさないのでスルー
	# i: string, B[i] = count
	if B[i] < 2: continue

	# 2個以上あれば長方形にスタック
	C.append(int(i))

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: D.append(int(i))

# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))

Buggy python submission (verdict: Runtime Error):
M = int(input())
A = list(map(int,input().split()))
B = [0]*(M+1)
C = [0]*2
D = [0]*2

for i in range(len(A)):
	B[ A[i] ] += 1 # カウント

for i in range(len(B)):
	# 一個しかなかったら条件を満たさないのでするー
	if B[i] < 2: continue

	# 2個以上あれば長方形にスタック
	C.append(i)

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: D.append(i)
# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))

Fixed submission:
M = int(input())
A = list(map(int,input().split()))
B = {}
C = [0]*2
D = [0]*2

for i in range(len(A)):
	a = str(A[i])
	# 存在したらカウントアップ
	if (a in B): B[ str(A[i]) ] += 1 # カウント
	# 存在しなかったら 1 で初期化
	else: B[ str(A[i]) ] = 1 # カウント
	# {"1":2, "2":3, "3":1}

for i in B:
	# 一個しかなかったら条件を満たさないのでスルー
	# i: string, B[i] = count
	if B[i] < 2: continue

	# 2個以上あれば長方形にスタック
	C.append(int(i))

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: D.append(int(i))

# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))

Buggy python submission (verdict: Runtime Error):
M = int(input())
A = list(map(int,input().split()))
B = [0]*(M+1)
C = [0]*2
D = [0]*2

for i in range(len(A)):
		B[ A[i] ] += 1 # カウント

		# Ai = 1, 1, 2, 3, 2, 4
		# B[1] = 2
		# B[2] = 2
		# B[3] = 1
		# B[4] = 1
		# B[100000] = ***

for i in range(len(B)):
	# 一個しかなかったら条件を満たさないのでするー
	if B[i] < 2: continue

	# 2個以上あれば長方形にスタック
	C.append(i)

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: D.append(i)
# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))

Fixed submission:
M = int(input())
A = list(map(int,input().split()))
B = {}
C = [0]*2
D = [0]*2

for i in range(len(A)):
	a = str(A[i])
	# 存在したらカウントアップ
	if (a in B): B[ str(A[i]) ] += 1 # カウント
	# 存在しなかったら 1 で初期化
	else: B[ str(A[i]) ] = 1 # カウント
	# {"1":2, "2":3, "3":1}

for i in B:
	# 一個しかなかったら条件を満たさないのでスルー
	# i: string, B[i] = count
	if B[i] < 2: continue

	# 2個以上あれば長方形にスタック
	C.append(int(i))

	# 4個以上あれば正方形にスタック
	if B[i] >= 4: D.append(int(i))

# C を降順でソート
C = sorted(C, reverse=True)

rect = C[0] * C[1]
s = max(D)
square = s * s

print(max(rect,square))
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
four = len(l)
two = len(ll)-four
zero = N-two
a = math.floor(N/2)
if a <= four and b == 0:
  print("Yes")
elif a-two <= four:
  print("Yes")
else:
  print("No")

Fixed submission:
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
four = len(l)
two = len(ll)-four
zero = N-two
a = math.floor(N/2)
if a <= four:
  print("Yes")
elif a-two/2 <= four:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
O = list(input())
E = list(input())
ans = list()
 
for i in range(len(O)):
    ans.append(O[i])
    if i > len(E):
        break
    else:
        ans.append(E[i])
result = "".join(ans)
print(result)

Fixed submission:
O = list(input())
E = list(input())
ans = list()
LEN = len(O)+len(E)
for i in range(LEN):
    if i%2==0:
        ans.append(O[0])
        del O[0]
    else:
        ans.append(E[0])
        del E[0]
result = "".join(ans)
print(result)

Buggy python submission (verdict: Runtime Error):
O = list(input())
E = list(input())
ans = list()
 
for i in range(len(O)):
    ans.append(O[i])
    if not E[i]:
        break
    else:
        ans.append(E[i])
result = "".join(ans)
print(result)

Fixed submission:
O = list(input())
E = list(input())
ans = list()
LEN = len(O)+len(E)
for i in range(LEN):
    if i%2==0:
        ans.append(O[0])
        del O[0]
    else:
        ans.append(E[0])
        del E[0]
result = "".join(ans)
print(result)

Buggy python submission (verdict: Runtime Error):
O = list(input())
E = list(input())
ans = list()

for i in range(len(O)):
    ans.append(O[i])
    ans.append(E[i])
result = "".join(ans)
print(result)

Fixed submission:
O = list(input())
E = list(input())
ans = list()
LEN = len(O)+len(E)
for i in range(LEN):
    if i%2==0:
        ans.append(O[0])
        del O[0]
    else:
        ans.append(E[0])
        del E[0]
result = "".join(ans)
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = 1
for i in range(1,n+1):
    a = i*a
a = a%(10**9+7)
print(a)

Fixed submission:
import math
n = int(input())
a = math.factorial(n)
print(a%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = 1
for i in range(1,n+1):
    a = i*a
a = a%(10**9+7)
print(a)

Fixed submission:
import math
n = int(input())
a = math.factorial(n)
print(a%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(N):
	if i % 2 == 0 and A[i] % 2 == 1:
    	count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(N):
  if i % 2 == 0 and A[i] % 2 == 1:
    count += 1
print(count)