#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n], mini, side = 1;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    mini = a[n - 1];
    for (int i = n - 2; i >= 0; i--) {
      long long int ptr = side + 1;
      mini = min(mini, a[i]);
      if (mini >= ptr)
        side++;
      else
        break;
    }
    cout << side << "\n";
  }
}
