iterations = int(input())
while iterations :
numberOfWords, numberOfLines = map(int, input().split())
wordsDictionary = {};
statusString = ""
for word in input().split():
wordsDictionary[ word ] = "NO"
#print( wordsDictionary )
while numberOfLines :
sentence = input().split()[ 1: ]
#print( line )
for sentenceWords in sentence:
if sentenceWords in wordsDictionary:
wordsDictionary[ sentenceWords ] = "YES"
numberOfLines -= 1
for word in wordsDictionary:
statusString += ( wordsDictionary[ word ] + " ")
print( statusString[ : -1 ] )
iterations -= 1
↧
In FRGTNLNG question Which test case is getting failed?
↧