Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. n1 = int(input())
  2. for n1 in range(n1):
  3.  
  4. n2 = int(input())
  5. q = input().split()
  6. n3 = int(q[0])
  7. n4 = int(q[1])
  8. n5 = int(q[2])
  9. n6 = int(q[3])
  10. n7 = int(input())
  11.  
  12. if n2 <= 0 or n3 <= 0 or n4 <= 0 or n5 <= 0 or n6 <= 0 or n7 <= 0:
  13. print("NAO")
  14.  
  15. elif n2 >= 7 or n3 >= 7 or n4 >= 7 or n5 >= 7 or n6 >= 7 or n7 >= 7:
  16. print("NAO")
  17.  
  18. else:
  19. if n2 + n7 == 7 and n3 + n5 == 7 and n4 + n6 == 7:
  20. print("SIM")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement