UVa 10919 - Prerequisites?

10919 - Prerequisites?

 * http://acm.uva.es/p/v109/10919.html

Summary
Given a list of classes taken and some conditions of the form "take k classes from this set", determine whether all of the conditions are satisfied.

Explanation
Pretty simple. Read in the list of classes taken, then loop over all requirements. Since classes can be used to fulfill multiple prerequisites, we don't have to worry about "using up" any of the classes that we've taken. With the problem constraints at most 100, pretty much anything will run in time.

Input
3 2 0123 9876 2222 2 1 8888 2222 3 2 9876 2222 7654 3 2 0123 9876 2222 2 2 8888 2222 3 2 7654 9876 2222 0

Output
yes no