Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. n= int(input())
  2. max2=-1
  3. max13=-1
  4. max26=-1
  5. pos=0
  6. pos2=0
  7. pos3=0
  8. maxx=-1
  9. maxy=-1
  10. for i in range(0,n):
  11. h=int(input())
  12. if h%26==0:
  13. if h>max26:
  14. max26=h
  15. pos=i
  16. elif h%13:
  17. if h>max13:
  18. max13=h
  19. elif h%2:
  20. if h>max2:
  21. max2=h
  22. if h>maxx:
  23. maxy=maxx
  24. pos2=i
  25. else:
  26. if h>maxy
  27. pos3=i
  28. maxy=h
  29. if max26!=-1 and pos!=pos2:
  30. print(max26*maxx)
  31. elif max26!=-1 and pos!=pos3:
  32. print(max26*maxy)
  33. elif max13!=-1 and max2!=-1
  34. print(max13*max2)
  35. else:
  36. print(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement