Tables
Time limit1sMemory limit128 MB
Given box screw counts, find the fewest boxes whose screws total at least s*k.
Problem
Byteman works as a carpenter. He has just received an order for pine-wood tables. His workshop has plenty of pine boards, but he has run out of screws, so he must walk to the warehouse and carry back some boxes of screws. Building one table needs exactly screws. What is the minimum number of boxes he has to bring so that he has enough screws to build all tables?
Input
The first line contains three integers , , and (), separated by single spaces: the number of screw boxes in the warehouse, the number of screws each table needs, and the number of tables to build.
The second line contains integers (), separated by single spaces, where is the number of screws in the -th box. The values are not necessarily distinct.
Output
Print a single integer: the minimum number of boxes Byteman must bring from the warehouse to build all tables. You may assume the warehouse holds enough screws to build every table.
Hint
Building three tables that each need six screws takes screws in total. Byteman can reach this with three boxes, for example the boxes holding 3, 7, and 9 screws, or the boxes holding 9, 5, and 7 screws. No two boxes add up to 18, so the answer is 3.