Shil and the Toy Factory
All submissions for this problem are available.
Shil is the owner of a magical toy factory. His factory has K machines which can produce toys simultaneously. The ith machine takes Ti minutes to produce a toy.
As the festive season is nearing, the demand for toys has increased. Shil has recently received an order for N toys. Shil wants to deliver the order as soon as possible. Help him determine the minimum amount of time that is required to produce N toys.
First line of input contains K and N.
Second line contains K space separated integers. The ith integer represents time Ti.
Output contains a single integer, the minimum time required to produce the toys.
- 1 ≤ K ≤ 1000
- 1 ≤ Ti ≤ 1000
- 1 ≤ N ≤ 10^9
2 4 1 3 Output:
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions