Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #coding: utf-8
- a = []
- N = int(input())
- for i in range(N):
- a.append(int(input()))
- x = 12001
- y = 12001
- m = x + y
- for i in range(N):
- for j in range(i + 1, N):
- if a[i] < a[j]:
- s = a[i] + a[j]
- if s % 144 == 0 and s <= m:
- x = a[i]
- y = a[j]
- m = s
- print(0 if m == 24002 else str(x) + ' ' + str(y))
Add Comment
Please, Sign In to add comment