| GPL 2023 Advanced |
|---|
| Finished |
Maya wants to organize the training data for her machine-learning model. There are $$$N$$$ files that she can use, and each file has a size of $$$s_i$$$ bits. Her computer has a limited amount of storage, so she can only allocate $$$X$$$ bits toward storing all of the training data.
What is the maximum number of files that she can use for her model?
Line 1: Two integers, $$$N$$$ and $$$X$$$. Lines 2 ... $$$N+1$$$: 1 space-separated integer $$$s_i$$$ representing the $$$i$$$th file's size in bits.
Line 1: One integer representing the maximum number of files that Maya can use.
5 34 14 25 47 11 6
3
6 18 2 5 6 4 13 1
5
$$$1 ≤ N ≤ 100,000$$$
$$$1 ≤ s_i ≤ 10^9$$$
$$$1 ≤ X ≤ 10^9$$$
| Name |
|---|


