#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
    }
    sort(v.begin(), v.end());
    int l = 0, r = 1, sq = 1;
    while (r < n) {
      if (r - l + 1 > v[l]) {
        l++;
      } else {
        sq = max(sq, r - l + 1);
        r++;
      }
    }
    cout << sq << endl;
  }
}
