Модуль: USE-2022. Question 26. An array of numbers. Sorting


Задача

3/10

Number of numbers with sum not greater than S

Задача

The file contains positive integers. The first line of the file contains the number N - the number of numbers, and the natural number S. The following N lines contain the actual numbers.
In your answer, indicate two numbers separated by a space: first, the maximum number of numbers that must be added so that the sum does not exceed the number S, then the value of the resulting sum.

Выберите правильный ответ, либо введите его в поле ввода

Комментарий учителя