Sphere Online Judge

SPOJ Problem Set (classical)

4301. Tables

Problem code: AE1B

Byteman works as a carpenter. He has just received an order for s pine-wood tables. Although he has plenty of pine-wood boards in his workshop, he has just run out of screws. Therefore he needs to walk to the warehouse and bring back some boxes with screws. What is the minimum number of boxes that he needs to bring in order to have enough screws to make the tables?

Input

The first line of the standard input contains three integers n, k, and s (1 ≤ n, k, s ≤ 1000) separated with single spaces. They denote the number of boxes with screws in Byteman's warehouse, the number of screws needed to make a table and the number of tables to be made by Byteman, respectively. The second line contains n (not necessarily different) integers ai (1 ≤ ai ≤ 1000) separated with single spaces, such that ai is the number of screws in the ith box in the warehouse.

Output

The first and only line of the standard output should contain a single integer - the minimal number of boxes with screws that Byteman needs to bring from his warehouse in order to make s tables. You may assume that Byteman has enough screws in the warehouse to make all tables.

Example

For the input data:

5 6 3
3 9 5 7 3

the correct result is:

3

Explanation of the example. To make three tables, each of which requires six screws, Byteman has to bring three boxes with screws from the warehouse. These can be either the ones containing 3, 7 and 9 screws, or the ones with 9, 5 and 7 screws.

Task author: Jakub Lacki.


Added by:Race with time
Date:2009-05-03
Time limit:1s
Source limit:50000B
Languages:All except: ERL TECS JS
Resource:Algorithmic Engagements 2009

hide comments
2009-12-12 05:48:38 gowtham.pnvs
It does not matter even if a '\n' is used .
2009-10-16 12:05:30 Seshadri R
This is a sub-set of STAMPS problem
2009-08-03 20:02:59 Brian
The regular judge is not that picky. In fact, you can often get AC even if you print a space instead of a newline. Trailing newlines should not pose any problem.
2009-07-31 20:23:07 ahmed 3okl
i will make \n or not
2009-07-30 20:49:21 Drew Saltarelli
huh? \n worked fine for me
2009-07-12 19:55:54 Ashok vardhan
Friends please don't print '\n'...!!!! Because of that i got WA 10 times.....!!!!
SPOJ System © 2008-2010 Sphere Research Labs. All Rights Reserved.