407960: GYM102951 B Studying Algorithms
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
B. Studying Algorithmstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
Steph wants to improve her knowledge of algorithms over winter break. She has a total of $$$X$$$ ($$$1 \leq X \leq 10^4$$$) minutes to dedicate to learning algorithms. There are $$$N$$$ ($$$1 \leq N \leq 100$$$) algorithms, and each one of them requires $$$a_i$$$ ($$$1 \leq a_i \leq 100$$$) minutes to learn. Find the maximum number of algorithms she can learn.
InputLine 1: Two space-separated integers $$$N$$$ and $$$X$$$
Line 2: $$$N$$$ space-separated integers $$$a_1, a_2, \dots a_N$$$
OutputA single integer, the answer to the problem.
ExampleInput6 15 4 3 8 4 7 3Output
4