#include <bits/stdc++.h>
using namespace std;
int n, k, q;
int a[1010];
int main() {
  cin >> q;
  for (int t = 0; t < q; t++) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> k;
      a[k]++;
    }
    int maxi = 0;
    int count = 0;
    for (int i = 1; i <= 1000; i++) {
      int r = min(i, n - count);
      maxi = max(maxi, r);
      count += a[i];
    }
    cout << maxi << endl;
    memset(a, 0, sizeof(a));
  }
  return 0;
}
