CF1243A Maximum Square

题目描述

### 题意简述 给定 $n$ 个正整数 $a_1,a_2,···,a_n$。请你从中选取 $x$ 个正整数 $b_1,b_2,···,b_x$,使得其满足: $$b_i\geq x(1\leq i \leq x)$$ 您需要最大化 $x$。

输入格式

第一行一个正整数 $k(1\leq k \leq 10)$,表示数据的组数。 对于每组数据,第一行一个正整数 $n(1\leq n \leq 1000)$。 接下来一行 $n$ 个正整数 $a_1,a_2,···,a_n$。

输出格式

对于每组数据,输出 $x$。您需要最大化 $x$。

说明/提示

The first sample corresponds to the example in the statement. In the second sample, gluing all $ 4 $ planks will result in a $ 4 \times 4 $ square. In the third sample, the maximum possible square is $ 1 \times 1 $ and can be taken simply as any of the planks.