Alice works as a restaurant manager. The restaurant has prepared \(N\) lunch boxes and Alice plans to distribute them to some schools. Consider that there are \(M\) schools and an \(i^{th}\) school orders \(A_i\) lunch boxes.
She wants to distribute lunch boxes to as many schools as possible. Also, she has the following rule:
- For an \(i^{th}\) school, she gives either zero or \(A_i\) lunch boxes
Your task is to help Alice to determine the maximum number of schools that can get lunch boxes.
Input format
- The first contains an integer \(t\) that denotes the number of test cases in the input.
- Each test case consists of two lines:
- The first line contains two integers \(N\) and \(M\).
- The second line contains \(M\) integers \(A_1,A_2,...,A_m\).
Output format
For each test case, you are required to print one integer that represents the maximum number of schools that can receive lunch boxes.
Constraints
\(1≤t≤10\)
\(1≤N,M≤10^5\)
\(1≤A_i≤10^6,1≤i≤M\)
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial