#P10184. [YDOI R1] whk
[YDOI R1] whk
Background
Little Z wants to grind whk.
Problem Description
Little Z needs to grind a total of subjects. For the -th subject, he has one and only problems. There are infinitely many days available, and each day Little Z can solve infinitely many problems.
If Little Z considers a day to be interesting, it is only when on that day he solves problems from at least subjects.
Little Z wants to know the maximum number of interesting days.
Input Format
The first line contains positive integers .
The next line contains integers: .
Output Format
Output one integer, the maximum number of days that Little Z considers interesting.
5 3
3 2 5 1 1
3
6 4
1 1 4 5 1 4
3
Hint
Subtask 0 is hack testdata and is not scored.
This problem uses bundled tests.
| Subtask ID | Special property | Score | ||
|---|---|---|---|---|
| None | ||||
| All are | ||||
| None | ||||
Constraints: for all testdata, , .
Translated by ChatGPT 5