Time limit
2s
Memory limit
128 MB
Sejun has M bags. Each bag may contain multiple gems as long as the total weight in that bag does not exceed C grams.
There are N gems in a jewelry shop, and each gem can be taken at most once. Given the weight of each gem, find the maximum number of gems Sejun can put into the bags.
The first line contains the number of gems N, the number of bags M, and the maximum weight C that one bag can hold.
The second line contains the weights of the N gems, separated by spaces. Each weight is an integer from 1 to 20.
Print the maximum number of gems Sejun can take.