#C9089. Minimum Problems to Solve

    ID: 53143 Type: Default 1000ms 256MiB

Minimum Problems to Solve

Minimum Problems to Solve

Given a set of n problems, each with an associated point value, you are required to determine the minimum number of problems you must solve in order to accumulate at least k points. You can solve the problems in any order. The optimal strategy is to solve the problems with the highest points first. Mathematically, if you select problems with points \(p_1, p_2, \dots, p_m\) (sorted in descending order), then you need the smallest \(m\) such that \(\sum_{i=1}^{m} p_i \ge k\).

inputFormat

The first line contains two integers n and k, where n is the number of problems and k is the minimum required points. The second line contains n space-separated integers representing the points for each problem.

outputFormat

Output a single integer, the minimum number of problems required to reach at least k points.

## sample
5 10
1 2 3 4 5
3

</p>