Question
Budget Balance

Bob oversees N projects, with the ith project initially funded with Ai. Each project needs at least X funding. Funds can be shifted from project i to project j only if project i retains at least X. Determine the maximum number of projects that can achieve the minimum funding X after transfers.

Input
The first line of input will contain a single integer T, denoting the number of test cases.
Each test case consists of two lines of input.
The first line of each test case contains two space-separated integers N and X - the number of projects and the minimum budget requirement of each project, respectively.
The next line consists of N space-separated integers A1, A2, ..., AN, denoting the initial budget allocated to each project.
Output
For each test case, output on a new line, the maximum number of projects that can meet the minimum required budget of X after possible transfers.
Example
Input
2
3 2
2 1 3
3 3
1 1 2
Output
3
0
Explanation
Test case 1: The minimum requirement for each sector is 2. Since sector 3 was allocated 3 units initially, 1 unit can be transferred to sector 2, leading to a final allocation of [2, 2, 2]. Thus,
3 sectors have the minimum required budget.
Test case 2: The minimum requirement for each sector is 3. Since no sector has surplus budget, no transfers would take place. Thus, 0 sectors have the minimum required budget.

Online