{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cp\u003eCows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.\u003c/p\u003e\n \u003cp\u003eFarmer John has cooked fabulous meals for his cows, but he forgot to check his menu against their preferences. Although he might not be able to stuff everybody, he wants to give a complete meal of both food and drink to as many cows as possible.\u003c/p\u003e\n \u003cp\u003eFarmer John has cooked \u003ci\u003eF\u003c/i\u003e (1 ≤ \u003ci\u003eF\u003c/i\u003e ≤ 100) types of foods and prepared \u003ci\u003eD\u003c/i\u003e (1 ≤ \u003ci\u003eD\u003c/i\u003e ≤ 100) types of drinks. Each of his \u003ci\u003eN\u003c/i\u003e (1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100) cows has decided whether she is willing to eat a particular food or drink a particular drink. Farmer John must assign a food type and a drink type to each cow to maximize the number of cows who get both.\u003c/p\u003e\n \u003cp\u003eEach dish or drink can only be consumed by one cow (i.e., once food type 2 is assigned to a cow, no other cow can be assigned food type 2).\u003c/p\u003e\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Line 1: Three space-separated integers: \n \u003ci\u003eN\u003c/i\u003e, \n \u003ci\u003eF\u003c/i\u003e, and \n \u003ci\u003eD\u003c/i\u003e \n \u003cbr\u003eLines 2..\n \u003ci\u003eN\u003c/i\u003e+1: Each line \n \u003ci\u003ei\u003c/i\u003e starts with a two integers \n \u003ci\u003eF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \n \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, the number of dishes that cow \n \u003ci\u003ei\u003c/i\u003e likes and the number of drinks that cow \n \u003ci\u003ei\u003c/i\u003e likes. The next \n \u003ci\u003eF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e integers denote the dishes that cow \n \u003ci\u003ei\u003c/i\u003e will eat, and the \n \u003ci\u003eD\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e integers following that denote the drinks that cow \n \u003ci\u003ei\u003c/i\u003e will drink.\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Line 1: A single integer that is the maximum number of cows that can be fed both food and drink that conform to their wishes\n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e4 3 3\n2 2 1 2 3 1\n2 2 2 3 1 2\n2 2 1 3 1 2\n2 1 1 3 3\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n One way to satisfy three cows is: \n \u003cbr\u003eCow 1: no meal \n \u003cbr\u003eCow 2: Food #2, Drink #2 \n \u003cbr\u003eCow 3: Food #1, Drink #1 \n \u003cbr\u003eCow 4: Food #3, Drink #3 \n \u003cbr\u003eThe pigeon-hole principle tells us we can do no better since there are only three kinds of food or drink. Other test data sets are more challenging, of course.\n \u003c/div\u003e"}},{"title":"Translation","value":{"format":"HTML","content":"有F种食物和D种饮料,每种食物或饮料只能供一头牛享用,且每头牛只享用一种食物和一种饮料。现在有N头牛,每头牛都有自己喜欢的食物种类列表和饮料种类列表,问最多能使几头牛同时享用到自己喜欢的食物和饮料。(1 \u003c\u003d F \u003c\u003d 100, 1 \u003c\u003d D \u003c\u003d 100, 1 \u003c\u003d N \u003c\u003d 100)"}}]}