CF1380C.Create The Teams

普及/提高-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are nn programmers that you want to split into several non-empty teams. The skill of the ii-th programmer is aia_i. You want to assemble the maximum number of teams from them. There is a restriction for each team: the number of programmers in the team multiplied by the minimum skill among all programmers in the team must be at least xx.

Each programmer should belong to at most one team. Some programmers may be left without a team.

Calculate the maximum number of teams that you can assemble.

有 nn 名程序员,你需要将他们分成若干个非空团队。第 ii 名程序员的技能值为 aia_i。你的目标是从这些人中组建尽可能多的团队。每个团队需满足如下限制:该团队中程序员人数乘以该团队中所有程序员的最小技能值,至少为 xx。

每名程序员至多属于一个团队;部分程序员可能无法被分入任何团队。

请计算你能组建的团队数量的最大值。

输入格式

The first line contains the integer tt (1≤t≤10001 \le t \le 1000) — the number of test cases.

The first line of each test case contains two integers nn and xx (1≤n≤105;1≤x≤1091 \le n \le 10^5; 1 \le x \le 10^9) — the number of programmers and the restriction of team skill respectively.

The second line of each test case contains nn integers a1,a2,…,ana_1, a_2, \dots , a_n (1≤ai≤1091 \le a_i \le 10^9), where aia_i is the skill of the ii-th programmer.

The sum of nn over all inputs does not exceed 10510^5.

第一行包含一个整数 tt(1≤t≤10001 \le t \le 1000)—— 表示测试用例的数量。

每个测试用例的第一行包含两个整数 nn 和 xx(1≤n≤1051 \le n \le 10^5;1≤x≤1091 \le x \le 10^9)—— 分别表示程序员的数量和团队技能限制。

每个测试用例的第二行包含 nn 个整数 a1,a2,…,ana_1, a_2, \dots , a_n(1≤ai≤1091 \le a_i \le 10^9),其中 aia_i 表示第 ii 个程序员的技能值。

所有输入中 nn 的总和不超过 10510^5。

输出格式

For each test case print one integer — the maximum number of teams that you can assemble.

对于每个测试用例,输出一个整数——你能组建的最大队伍数量。

输入输出样例

  • 输入#1

    3
    5 10
    7 11 2 9 5
    4 8
    2 4 2 3
    4 11
    1 3 3 7

    输出#1

    2
    1
    0

输入解题思路,AI测评打分。不知道怎么写?

首页