Problem D
Waif Until Dark
“Waif Until Dark” is a daycare center specializing in children of households where both parents work during the day. In order to keep the little monsters …that is, darlings …occupied, the center has a set of toys that the kiddies can play with. Some of these toys belong to one of several categories – sports toys, musical toys, dolls, etc. In order to save wear and tear on these types of toys, the teachers allow only certain numbers of toys of each category to be used during playtime. Of course, kids being kids, not all of the toys are liked by everyone, so sometimes it’s difficult to make sure every kid has a toy they like. Given all of these constraints, the CEO of Waif has come to you to write a little program to determine the maximum number of these monsters (let’s be honest here) who can be satisfied.
Input
Input starts with a line containing three integers
Output
Display the maximum number of children that can be satisfied with a toy that they like, provided that each toy can be used by at most one child.
Sample Input 1 | Sample Output 1 |
---|---|
4 3 1 2 1 2 2 1 2 1 3 1 3 2 1 2 1 |
2 |