Shiyan12

Задание 27.114

Dec 5th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. #coding: utf-8
  2. a = []
  3. N = int(input())
  4. for i in range(N):
  5.     a.append(int(input()))
  6. x = 12001
  7. y = 12001
  8. m = x + y
  9. for i in range(N):
  10.     for j in range(i + 1, N):
  11.         if a[i] < a[j]:
  12.             s = a[i] + a[j]
  13.             if s % 144 == 0 and s <= m:
  14.                 x = a[i]
  15.                 y = a[j]
  16.                 m = s
  17. print(0 if m == 24002 else str(x) + ' ' + str(y))
Add Comment
Please, Sign In to add comment