int input A118 Anch A59 Ach for in range int input if 118 A118 max A11

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n = int(input())
A118 = 0;Anch = 0;A59 = 0;Ach = 0
for i in range(n):
a = int(input())
if a % 118 == 0: A118 = max(A118, a)
elif a % 59 == 0: A59 = max(A59, a); Anch = max(Anch, a)
elif a % 2 == 0: Ach = max(Ach, a)
else: Anch = max(Anch, a)
#print(A118,A59,Ach,Anch)
print(max(A118*Anch, A59*Ach))