407920: GYM102942 C Team

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Teamtime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given the programming skill of $$$n$$$ students. The programming skill of $$$i^{th}$$$ student is $$$a_i$$$.

You are given the duty of making teams for a programming competition. The skill level of a team is defined as the sum of the skills of the students in that team. The skill level of the team with only one student is the same as the skill of that student.

A team can have at most 2 students and the skill level of a team must be at least $$$k$$$.

Find the maximum number of teams that you can form under the given constraints.

Each student can be part of at most one team and it is possible that some students are not selected in any team.

Input

The first line contains an integer $$$t$$$ $$$(1 \leq t \leq 10^{2})$$$ — the number of test cases in the input.

Then $$$t$$$ test cases follow.

The first line of the test case contains two integer $$$n$$$ and $$$k$$$ $$$( 1 \leq n \leq 2\cdot10^{5}, 1 \leq k \leq 10^{6} )$$$ $$$-$$$ number of students and the minimum sum of skills of the members of a team.

The second line of the test case contains $$$n$$$ space-separated integers $$$a_i$$$ $$$( 1 \leq a_i \leq 10^{6} )$$$$$$-$$$$$$a_i$$$ is the programming skill of $$$i^{th}$$$ student.

It is guaranteed that the sum of $$$n$$$ does not exceed $$$2\cdot10^{5}(\sum n \leq 2\cdot10^{5})$$$.

Output

For each test case, Output the maximum number of teams you can form.

ExampleInput
3
5 8
9 3 4 4 5
5 8
5 2 3 5 1
3 6
7 6 8
Output
3
1
3
Note

In the first test, you can make at most 3 teams.

1st team: $$$1^{st}$$$ student.

2nd team: $$$2^{nd}$$$ and $$$5^{th}$$$ student.

3rd team: $$$3^{rd}$$$ and $$$4^{th}$$$ student.

In the third test, you can make 3 teams using one student each.

加入题单

算法标签: