#P8687. [蓝桥杯 2019 省 A] 糖果
[蓝桥杯 2019 省 A] 糖果
Description
The owner of the candy shop sells a total of flavors of candy. For convenience, we number the flavors from to .
Xiaoming wants to taste candies of all flavors. Unfortunately, the owner does not sell candies individually, but only sells them in whole packs, with candies per pack.
Luckily, each candy pack lists the flavors of the candies inside, so Xiaoming can know the flavors in a pack before buying it.
Given packs of candy, please compute the minimum number of packs Xiaoming needs to buy in order to taste all flavors of candy.
Input Format
The first line contains three integers , , and .
In the next lines, each line contains integers , representing the flavors of one pack of candy.
Output Format
Output one integer as the answer. If Xiaoming cannot taste all flavors, output .
6 5 3
1 1 2
1 2 3
1 1 3
2 3 5
5 4 2
5 1 2
2
Hint
For of the testdata, .
For all testdata, , , , .
Lanqiao Cup 2019 Provincial Contest A Division, Problem I.
Translated by ChatGPT 5
京公网安备 11011102002149号