#include <bits/stdc++.h>
const int maxx = 2e5 + 100;
const double eps = 1e-10;
const int mod = 10007;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
using namespace std;
int n, m, T;
int l, r, ans;
int a[maxx + 5];
int main() {
  int i, j, k;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    sort(a, a + n, greater<int>());
    for (i = 0; i < n; i++) {
      if (a[i] < i + 1) break;
    }
    printf("%d\n", i);
  }
  return 0;
}
