题库练习 Young Explorers
← 上一题 下一题 →

A13562 | Young Explorers

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided to split into groups to explore as much interesting locations as possible. Russell was trying to form groups, but ran into some difficulties...

Most of the young explorers are inexperienced, and sending them alone would be a mistake. Even Russell himself became senior explorer not long ago. Each of young explorers has a positive integer parameter $e_i$ — his inexperience. Russell decided that an explorer with inexperience $e$ can only join the group of $e$ or more people.

Now Russell needs to figure out how many groups he can organize. It's not necessary to include every explorer in one of the groups: some can stay in the camp. Russell is worried about this expedition, so he asked you to help him.

输入格式

The first line contains the number of independent test cases $T$ ( $1 \leq T \leq 2 \cdot 10^5$ ). Next $2T$ lines contain description of test cases.

The first line of description of each test case contains the number of young explorers $N$ ( $1 \leq N \leq 2 \cdot 10^5$ ).

The second line contains $N$ integers $e_1, e_2, \ldots, e_N$ ( $1 \leq e_i \leq N$ ), where $e_i$ is the inexperience of the $i$ -th explorer.

It's guaranteed that sum of all $N$ doesn't exceed $3 \cdot 10^5$ .

输出格式

Print $T$ numbers, each number on a separate line.

In $i$ -th line print the maximum number of groups Russell can form in $i$ -th test case.

输入输出样例

输入 #1
2
3
1 1 1
5
2 3 1 2 2
输出 #1
3
2
C++ 编辑器
输入
输出