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