NOI Contest Archive

Archive / 2024 / April 2024

Missile war

Hard · NOI 2024 April Monthly Contest

There are two countries \(A\) and \(B\) at war. Country \(A\) plans to attack \(t\) number of targets and country \(B\) wants to defend them.

\(A\) has \(n\) missile systems. Each missile system has a set of predifined targets and will attack all targets in that set.

\(B\) has \(m\) defence systems. Each defence system has a set of predifined targets and a defence capacity \(c\). A single defence system can choose to defend \(r\) targets in it’s set such that \(r \leq c\).

Your task is to find out the maximum amount of succesful defence operations that can be carried out by \(B\).

There can be multiple defence operations on a single target.

Input Format

Output Format

Constraints

Constraints:

Sample Input 0

2 2 3
1 1
2 2 3
2 1 2
1 3
1 2

Sample Output 0

2