#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
int n, t;
int a[100100];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    reverse(a + 1, a + n + 1);
    int ans = 0;
    for (int i = 1; i <= n; ++i) {
      if (a[i] >= i) ans++;
    }
    cout << ans << "\n";
  }
}
