HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC-2014-15 Questions > problem:


2nd-6. 50486 - Problems and Programmers

IMPC-2014-15 Questions

Start: Nov.22.2014 at 03:00:00 PM
Finish: Nov.22.2014 at 08:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 1st-2. 50483 - Group Total
• 1st-3. 50484 - Number Of Letters
• 1st-4. 50473 - Counting Circles Posit...
• 1st-6. 50485 - Center of gravity of ...
• 2nd-1. 50522 - Multiplication Table - 2
• 2nd-2. 50512 - Coding redundancy
• 2nd-3. 50533 - Contacts List
• 2nd-5. 50793 - Top M Customers
• 2nd-6. 50486 - Problems and P...
• 3rd-2. 50405 - Accounts Receivable
• 3rd-3. 50474 - Sum of Two Primes
• 3rd-4. 50406 - Draw Pattern 178
• 3rd-5. 50415 - The Scientist
• 3rd-6. 50695 - Longest link between...
• 4th-1. 50491 - Brokers
• 4th-2. 50524 - Elevator
• 4th-3. 50535 - Image Compression

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Osman Ay.

Problems and Programmers

A group of N teachers are assigned to solve M programming problems in a teacher professional development program. Every teacher chooses the problems he can solve. Since teachers are always busy, they want to make a possible smallest team to solve the given problems. What is the size of the smallest team that can solve all the problems?

Input specification
The first line of the input contains two integers N (1 ≤ N ≤ 20) and M (1 ≤ M ≤100). Each of the following N lines denotes the problems a teacher can solve with a set of K+1 integers. The first integer (K) is the number of the problems and the following K numbers are the problem IDs.

Output specification
The output contains a single integer that is number of the teachers in the smallest team. If it is not possible to solve all the problems, print the word "impossible".

Sample Input I
7 10
3 1 2 7
3 2 7 8
2 10 4
2 3 4
4 2 3 4 5
3 5 6 4
3 7 5 9
Sample Output I
6



Для отправки решений необходимо выполнить вход.

www.contester.ru