Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- s = int(input())
- m = s
- for i in range(n-1):
- s = int(input())
- if s < m and s % 3 == 0:
- m = s
- if m % 3 == 0:
- print(m)
- else:
- print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement