{"raw_statement":[{"iden":"statement","content":"You have a simple system in which you want to have a search function. You decided to implement it for searching email addresses. There is a bunch of email addresses in your program.\n\nUser enters an email address. And the function detects if there is one. If yes, then its answer is “yes”, otherwise it tries to change one symbol in the entered address (the error detection). Then, if it matches only one address, the answer is still “yes”. But if it detects more than one address or does not detect anything, the answer is “no“.\n\nThe first line contains the number of test cases _T_ (T ≤ 100). The first line of each test case contains the number of email addresses in the program _n_ and the number of queries _m_ (1 ≤ n, m ≤ 10). The following _n_ lines contain email addresses (only lowercase letters, digits and symbols “@”, “.”). The following m lines contain an email address, which is searched (only lowercase letters, digits and symbols “@”, “.”).\n\nNote: the length of email addresses doesn’t exceed 100.\n\nFor each test case output one line containing “_Case #tc:_”, where _tc_ is the number of the test case (starting from 1). Then output _m_ lines containing answers to the queries (“_yes_” or “_no_”).\n\n"},{"iden":"input","content":"The first line contains the number of test cases _T_ (T ≤ 100). The first line of each test case contains the number of email addresses in the program _n_ and the number of queries _m_ (1 ≤ n, m ≤ 10). The following _n_ lines contain email addresses (only lowercase letters, digits and symbols “@”, “.”). The following m lines contain an email address, which is searched (only lowercase letters, digits and symbols “@”, “.”).Note: the length of email addresses doesn’t exceed 100."},{"iden":"output","content":"For each test case output one line containing “_Case #tc:_”, where _tc_ is the number of the test case (starting from 1). Then output _m_ lines containing answers to the queries (“_yes_” or “_no_”)."},{"iden":"examples","content":"Input13 4[email protected][email protected][email protected][email protected][email protected][email protected][email protected]OutputCase #1:yesyesnono"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ tc \\in \\{1, \\dots, T\\} $:  \n- Let $ n, m \\in \\mathbb{Z} $ denote the number of stored email addresses and queries, respectively.  \n- Let $ E = \\{e_1, e_2, \\dots, e_n\\} $ be the set of stored email addresses, where each $ e_i $ is a string over the alphabet $ \\Sigma = \\{ \\text{lowercase letters}, \\text{digits}, @, . \\} $.  \n- Let $ Q = \\{q_1, q_2, \\dots, q_m\\} $ be the set of query email addresses, each $ q_j \\in \\Sigma^* $.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 100 $  \n2. For each test case:  \n   - $ 1 \\le n \\le 10 $, $ 1 \\le m \\le 10 $  \n   - $ |e_i| \\le 100 $, $ |q_j| \\le 100 $ for all $ i,j $  \n   - All strings contain only characters from $ \\Sigma $  \n\n**Objective**  \nFor each query $ q_j $:  \n- If $ q_j \\in E $, output “yes”.  \n- Else, let $ D(q_j) = \\{ e \\in E \\mid \\text{Hamming distance}(q_j, e) = 1 \\} $.  \n  - If $ |D(q_j)| = 1 $, output “yes”.  \n  - Otherwise (i.e., $ |D(q_j)| \\ne 1 $), output “no”.","simple_statement":"You are given a list of email addresses. For each query email, check if it exactly matches any address in the list. If not, check if changing exactly one character in the query email makes it match exactly one address in the list. If yes to either, output \"yes\"; otherwise, output \"no\".","has_page_source":false}