#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n];
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n, greater<int>());
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      if (arr[i] > ans) {
        ans++;
      } else {
        break;
      }
    }
    cout << ans << "\n";
  }
}
