Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- mas = [int(i) for i in range(N)]
- m1 = 0
- m2 = 0
- for e in mas:
- if (e % 3 == 0) and (e % 2 != 0):
- m1 = max(m1, e)
- if (e % 2 == 0) and (e % 3 != 0):
- m2 = max(m2, e)
- ans = m1 * m2
- m1 = 0
- m2 = 0
- for e in mas:
- if e % 6 != 0:
- m2 = max(m2, e)
- else:
- if (e > m1):
- if (m1 > m2):
- m2 = m1
- m1 = e
- else:
- m2 = max(m2, e)
- ans = max(ans, m1 * m2)
- if ans == 0:
- print("NO SOLUTION")
- else:
- print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement