Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n1 = int(input())
- for n1 in range(n1):
- n2 = int(input())
- q = input().split()
- n3 = int(q[0])
- n4 = int(q[1])
- n5 = int(q[2])
- n6 = int(q[3])
- n7 = int(input())
- if n2 <= 0 or n3 <= 0 or n4 <= 0 or n5 <= 0 or n6 <= 0 or n7 <= 0:
- print("NAO")
- elif n2 >= 7 or n3 >= 7 or n4 >= 7 or n5 >= 7 or n6 >= 7 or n7 >= 7:
- print("NAO")
- else:
- if n2 + n7 == 7 and n3 + n5 == 7 and n4 + n6 == 7:
- print("SIM")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement