Problem C
Incognito
![\includegraphics[width=0.3\textwidth ]{cartoon}](/problems/incognito/file/statement/en/img-0001.jpg)
Input
On the first line one positive number: the number of test cases, at most 100. After that per test case:
-
one line with an integer
( ): the number of available attributes. -
lines with two space-separated strings: the name and the category of the attribute.
All strings consist of at least
Output
Per test case:
-
one line with an integer: the number of possible distinct disguises that can be made with the given attributes, such that at most one attribute from each category is used.
Sample Input 1 | Sample Output 1 |
---|---|
2 3 hat headgear sunglasses eyewear turban headgear 3 mask face sunglasses face makeup face |
5 3 |