#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int a, b, c, m, n, p, q, r, x, y, z;
  long long int i, j, k, l;
  long long int cnt = 0, cnt1 = 0, cnt2 = 0, cnt3 = 0, sum = 0, mx = 0;
  long long int flag = 0;
  vector<long long int> vec1, vec2, vec3;
  string s1, s2, s3;
  cin >> n;
  for (long long int i = (long long int)(0); i < (long long int)(n); ++i) {
    cin >> x;
    vec1.push_back(x);
  }
  sort((vec1).begin(), (vec1).end());
  reverse((vec1).begin(), (vec1).end());
  for (long long int i = (long long int)(0); i < (long long int)(n); ++i) {
    if (vec1[i] >= i + 1)
      cnt++;
    else
      break;
  }
  cout << cnt << endl;
}
int main() {
  ios::sync_with_stdio(false);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
