Diverse Contest
시간 제한10초메모리 제한2048 MB
n개 문제 중 k개를 골라 만들 수 있는 대회 중, 어떤 주제도 고른 문제의 절반을 넘게 차지하지 않는 경우의 수를 센다.
문제
Write what you know! The judges for a certain programming competition have problems and are trying to prepare a contest using of them.
The judges have tagged each problem with a list of topics needed to solve that problem. To not overly punish teams for not knowing a specific topic, for any given topic, at most half of the problems on the contest can have that topic.
Compute the number of distinct contests the judges can prepare. Two contests are different if there is a problem that appears in one contest but not the other. In particular, the order of the problems in the contest does not matter.
입력
The first line of input has two integers and where () is the number of proposed problems and () is the number of problems that will be used in a contest. The next lines each begin with an integer (), the number of topics for that problem. Then follow unique topics. Each topic is a string of lowercase letters, each of length at most .
출력
Output the number of distinct contests the judges can prepare.