아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Diverse Contest

시간 제한10초메모리 제한2048 MB

요약
n개 문제 중 k개를 골라 만들 수 있는 대회 중, 어떤 주제도 고른 문제의 절반을 넘게 차지하지 않는 경우의 수를 센다.
난이도

보통10점 중 6점

유형
완전 탐색, 비트 연산, 조합론, 해시맵
정답자
아직 제출이 없습니다

문제

Write what you know! The judges for a certain programming competition have nn problems and are trying to prepare a contest using kk 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 nn and kk where nn (2≤n≤202 \leq n \leq 20) is the number of proposed problems and kk (2≤k≤n2 \leq k \leq n) is the number of problems that will be used in a contest. The next nn lines each begin with an integer tt (1≤t≤201 \leq t \leq 20), the number of topics for that problem. Then follow tt unique topics. Each topic is a string of lowercase letters, each of length at most 1010.

출력

Output the number of distinct contests the judges can prepare.

예제1

  1. 예제 1

    입력
    5 3
    1 string
    2 string queue
    1 queue
    2 dp greedy
    1 math
    
    예상 출력
    5