#C73. Minimum Team Formation
Minimum Team Formation
Minimum Team Formation
A company is organizing a hackathon and needs to form teams from a list of participants. Each participant has an identifier and a set of skills. A team is considered balanced if it contains at least one participant for every distinct skill available among all participants.
Formally, let \( S \) be the set of all skills that appear in the input. The objective is to select the smallest subset of participants such that the union of their skills is exactly \( S \). You are required to compute the minimum number of participants needed to form such a balanced team.
Input Format: The first line contains an integer \( t \) denoting the number of participants. Each of the following \( t \) lines contains a participant's identifier followed by one or more skills separated by spaces.
Output Format: Print a single integer representing the minimum number of participants required to form a balanced team.
Example:
Input: 4 p1 python sql p2 java p3 python java p4 sql css</p>Output: 2
inputFormat
The input is read from standard input and has the following format:
- The first line contains an integer \( t \) representing the number of participants.
- Each of the next \( t \) lines contains a participant's ID followed by one or more skills separated by spaces.
outputFormat
Output a single integer to standard output: the minimum number of participants required to form a balanced team that covers every distinct skill.
## sample4
p1 python sql
p2 java
p3 python java
p4 sql css
2