#C11974. Chef's Dishes Timer
Chef's Dishes Timer
Chef's Dishes Timer
A chef is planning to serve various dishes at his restaurant. For each test case, you are given the number of dishes N, the total available time K, and the preparation times of all dishes. The chef prepares the dishes in an optimal order, always choosing the dish that takes the least time first. Determine the maximum number of dishes that can be prepared such that the total preparation time does not exceed K. Formally, if the sorted preparation times are \( t_1, t_2, \dots, t_N \), the chef can prepare dishes while \( t_1 + t_2 + \cdots + t_m \leq K \). Each test case is independent.
Input and output are read from standard input and written to standard output.
inputFormat
The first line contains a single integer T, the number of test cases.
For each test case:
- The first line contains two space-separated integers N and K (the number of dishes and the available time, respectively).
- The second line contains N space-separated integers, each denoting the preparation time of a dish.
outputFormat
For each test case, output the maximum number of dishes that can be prepared within the given time. Print all the results in one line separated by a space, or each on a new line.
## sample2
5 10
2 3 7 1 4
4 7
4 3 2 5
4 2