#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    pq;
priority_queue<long long, vector<long long>, greater<long long> > pq1;
long long result(long long a, long long b, long long p) {
  long long ans = 1;
  if (b == (-1)) b = p - 2;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % p;
    }
    a = (a * a) % p;
    b >>= 1;
  }
  return ans;
}
long long T = 1, n, m, k;
int main() {
  if (fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> T;
  while (T--) {
    cin >> n;
    long long a[n];
    map<long long, long long> m;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      m[a[i]]++;
    }
    long long ans = 0;
    long long p = 0;
    for (int i = 1; i <= n; i++) {
      ans += (m[i] / i);
      p += (m[i] % i);
      if (p >= i) {
        ans++;
        p -= i;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
