#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int k;
  cin >> k;
  while (k--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int m;
      cin >> m;
      v.push_back(m);
    }
    int s = 0;
    sort(v.begin(), v.end());
    for (int i = n - 1; i >= 0; i--) {
      if (v[i] >= n - i) {
        s++;
        continue;
      } else {
        break;
      }
    }
    cout << s << "\n";
  }
}
