{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n In Google, there are many experts of different areas. For example, MapReduce experts, Bigtable experts, SQL experts, etc. Directors need to properly assign experts to various projects in order to make the projects going smoothly. \n \u003cbr\u003eThere are N projects owned by a director. For the $i^{th}$ project, it needs $C_i$ different areas of experts, $a_{i,0}, a_{i,1}, · · · , a_{i,C_i-1}$ respective. There are M engineers reporting to the director. For the $i^{th}$ engineer, he is an expert of $D_i$ different areas, $b_{i,0}, b_{i,1}, ... , b_{i,D_i-1}.$ \n \u003cbr\u003eEach engineer can only be assigned to one project and the director can assign several engineers to a project. A project can only be finished successfully if the engineers expert areas covers the project areas, which means, for each necessary area of the project, there is at least one engineer \n \u003cbr\u003emasters it. \n \u003cbr\u003eThe director wants to know how many projects can be successfully finished. \n \u003cbr\u003e \n\u003c/div\u003e\n题意:一共有n个任务,完成某个任务需要会一些领域的人,一共有m个工程师,每个工程师会一些领域,问这些工程师最多完成多少任务"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line consisting of 2 integers, N the number of projects and M the number of engineers. Then N lines follow. The $i^{th}$ line containing the information of the $i^{th}$ project starts \n\u003cbr\u003ewith an integer $C_i$ then $C_i$ integers follow, $a_{i,0}, a_{i,1}, ... , a_{i,C_i-1}$ representing the expert areas needed for the $i^{th}$ project. Then another M lines follow. The $i_{th}$ line containing the information of the $i^{th}$ engineer starts with an integer $D_i$ then $D_i$ integers follow, $b_{i,0}, b_{i,1}, ... , b_{i,D_i-1}$ representing the expert areas mastered by $i^{th}$ engineer. \n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line containing “Case #x: y”, where x is the test case number (starting from 1) and y is the maximum number of projects can be successfully finished. \n\u003cbr\u003e \n\u003ch2\u003elimits\u003c/h2\u003e \n\u003cbr\u003e$\\bullet 1 ≤ T ≤ 100.$ \n\u003cbr\u003e$\\bullet 1 ≤ N, M ≤ 10.$ \n\u003cbr\u003e$\\bullet 1 ≤ C_i ≤ 3.$ \n\u003cbr\u003e$\\bullet 1 ≤ D_i ≤ 2.$ \n\u003cbr\u003e$\\bullet 1 ≤ a_{i,j} , b_{i,j} ≤ 100.$ \n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1\n3 4\n3 40 77 64\n3 10 40 20\n3 40 20 77\n2 40 77\n2 77 64\n2 40 10\n2 20 77\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase #1: 2\n\n \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\nFor the first test case, there are 3 projects and 4 engineers. One of the optimal solution is to assign the first(40 77) and second engineer(77 64) to project 1, which could cover the necessary areas 40, 77, 64. Assign the third(40 10) and forth(20 77) engineer to project 2, which could cover the necessary areas 10, 40, 20. There are other solutions, but none of them can finish all 3 projects.\nSo the answer is 2.\n\n \n \u003c/pre\u003e"}}]}