Bad_Programist

Untitled

Jan 27th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. n = int(input())
  2. nums = list(map(int, input().split()))
  3. n1 = max(nums)
  4. c = False
  5. S = []
  6. nums.remove(n1)
  7. for i in nums:
  8.     if n1 % i != 0:
  9.         S.append(i)
  10.         c = True
  11. if c == False:
  12.     n2 = max(nums)
  13. else:
  14.     n2 = max(S)
  15. print(n1, n2)
Advertisement
Add Comment
Please, Sign In to add comment