#K64437. Taco Scheduling: Maximum Attendees

    ID: 31975 Type: Default 1000ms 256MiB

Taco Scheduling: Maximum Attendees

Taco Scheduling: Maximum Attendees

You are given the availability of employees for various days. Each employee provides a list of days that they are free. Your task is to determine the maximum number of employees that can attend a training session if the session is scheduled on an optimal day.

Mathematically, let \(D\) be the set of all days. For each day \(d\), let \(cnt(d)\) be the number of employees available on day \(d\). Your answer for each test case is \(\max_{d \in D}cnt(d)\). If no employee is free, then the answer is 0.

The input consists of multiple test cases. For each test case, you are given an integer \(N\) indicating the number of employees, followed by \(N\) lines. Each of these lines begins with an integer representing the count of free days for that employee, followed by the list of available days.

inputFormat

The first line contains a single integer, \(T\), denoting the number of test cases.

For each test case:

  • The first line contains an integer \(N\), the number of employees.
  • This is followed by \(N\) lines. Each line starts with an integer \(k\) indicating the number of free days for an employee, followed by \(k\) space-separated integers representing the available days.

Input is read from standard input.

outputFormat

For each test case, output a single integer representing the maximum number of employees that can attend the training session if scheduled optimally. Each answer should be printed on a new line to standard output.

## sample
1
1
1 1
1

</p>