Advertisement
1nikitas

Untitled

Apr 6th, 2020
1,039
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2.  
  3. max1 = 1
  4. max2 = 1
  5. max3 = 1
  6.  
  7. flag = False
  8. for i in range(n):
  9.     x = int(input())
  10.     if x > max3 and x % 5 == 0:
  11.         max3 = x
  12.         flag = True
  13.     if (x > max1):
  14.         max1 = max2
  15.         max2 = x
  16.     else:
  17.         if x > max2:
  18.             max2 = x
  19. if flag != True:
  20.     print("NO")
  21. else:
  22.     print(max1,max2, max3)
Advertisement
RAW Paste Data Copied
Advertisement