Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided to split into groups to explore as much interesting locations as possible. Russell was trying to form groups, but ran into some difficulties...

Most of the young explorers are inexperienced, and sending them alone would be a mistake. Even Russell himself became senior explorer not long ago. Each of young explorers has a positive integer parameter $e_i$ — his inexperience. Russell decided that an explorer with inexperience $e$ can only join the group of $e$ or more people.

Now Russell needs to figure out how many groups he can organize. It's not necessary to include every explorer in one of the groups: some can stay in the camp. Russell is worried about this expedition, so he asked you to help him.


-----Input-----

The first line contains the number of independent test cases $T$($1 \leq T \leq 2 \cdot 10^5$). Next $2T$ lines contain description of test cases.

The first line of description of each test case contains the number of young explorers $N$ ($1 \leq N \leq 2 \cdot 10^5$).

The second line contains $N$ integers $e_1, e_2, \ldots, e_N$ ($1 \leq e_i \leq N$), where $e_i$ is the inexperience of the $i$-th explorer.

It's guaranteed that sum of all $N$ doesn't exceed $3 \cdot 10^5$.


-----Output-----

Print $T$ numbers, each number on a separate line.

In $i$-th line print the maximum number of groups Russell can form in $i$-th test case.


-----Example-----
Input
2
3
1 1 1
5
2 3 1 2 2

Output
3
2



-----Note-----

In the first example we can organize three groups. There will be only one explorer in each group. It's correct because inexperience of each explorer equals to $1$, so it's not less than the size of his group.

In the second example we can organize two groups. Explorers with inexperience $1$, $2$ and $3$ will form the first group, and the other two explorers with inexperience equal to $2$ will form the second group.

This solution is not unique. For example, we can form the first group using the three explorers with inexperience equal to $2$, and the second group using only one explorer with inexperience equal to $1$. In this case the young explorer with inexperience equal to $3$ will not be included in any group.

Difficulty: EASY
Tags: Dynamic programming

Sorting

Greedy algorithms
Skill types: Dynamic programming

Sorting

Greedy algorithms

Starter code:

Solutions:
import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = int(input())
	a = sorted(array())
	ind = bisect_right(a, n)
	size = []
	d = Counter(a)
	ans = 0
	for i in d:
		if d[i] >= i:
			size += [i] * (d[i] // i)
			ans += d[i] // i
			d[i] = d[i] % i
	rem = []
	for i in a:
		if d[i] != 0:
			rem.append(i)
			d[i] -= 1
	si = 0
	for i in rem:
		if si + 1 == i:
			ans += 1
			si = -1
		si += 1
	print(ans)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
import threading
import bisect
import heapq
input = sys.stdin.readline

def run(val):
	array = []
	while val > 0:
		array.append(val % 10)
		val = val // 10
	minElv = 9999999999
	maxElv = 0
	for i in range(len(array)):
		minElv = min(array[i], minElv)
		maxElv = max(array[i], maxElv)
	return minElv * maxElv
for t in range(int(input())):
	n = int(input())
	iA = list(map(int, input().split()))
	fA = []
	sA = []
	iA.append(1000000)
	iA.sort()
	s = iA[0]
	c = 0
	for i in range(n + 1):
		if s != iA[i]:
			fA.append(iA[i - 1])
			sA.append(c)
			c = 1
			s = iA[i]
		else:
			c += 1
	answer = 0
	s = 0
	for i in range(len(fA)):
		answer += sA[i] // fA[i]
		s += sA[i] % fA[i]
		if s // fA[i] > 0:
			answer += s // fA[i]
			s = s % fA[i]
	print(answer)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	input()
	c = ans = 0
	for i in sorted(map(int, input().split())):
		c += 1
		if c >= i:
			ans += 1
			c = 0
	print(ans)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	N = int(stdin.readline())
	people = [int(var) for var in stdin.readline().split()]
	people.sort()
	ans = 0
	(start, end, lmt) = (0, 0, people[0])
	while end < len(people):
		if end - start + 1 >= lmt:
			(start, end) = (end + 1, end + 1)
			if end < len(people):
				lmt = people[start]
			ans += 1
		else:
			if end + 1 < len(people):
				lmt = max(lmt, people[end + 1])
			end += 1
	print(ans)


import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve_case(exp_inp, n):
	exp_inp.sort()
	groups = 0
	cur = 0
	for i in range(n):
		if exp_inp[i] <= i - cur + 1:
			cur = i + 1
			groups += 1
	print(groups)
t = nn()
for _ in range(t):
	n = nn()
	exp = lm()
	solve_case(exp, n)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1 and a[0] == 1:
		print('1')
	else:
		a.sort()
		count = 0
		cc = 1
		for i in range(n):
			if cc == a[i]:
				count += 1
				cc = 1
			else:
				cc += 1
		print(count)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	grp = 0
	j = 1
	d = n
	if n == 1 and l[0] == 1:
		grp = 1
	else:
		for i in range(d):
			if l[i] > n:
				break
			if l[i] > j:
				j += 1
			else:
				grp += 1
				n = n - j
				j = 1
	print(grp)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	w = sorted(map(int, input().split()))
	(c, d, e) = (0, 0, 0)
	for i in w:
		d = i
		e += 1
		if d <= e:
			c += 1
			e = 0
	print(c)


import collections
from sys import stdin, stdout
for _ in range(int(stdin.readline().strip())):
	n = int(stdin.readline().strip())
	e = list(map(int, stdin.readline().split()))
	cnt = collections.defaultdict(int)
	for i in e:
		cnt[i] += 1
	ans = 0
	rem = []
	for i in cnt:
		ans += cnt[i] // i
		rem += [i] * (cnt[i] - i * (cnt[i] // i))
	c = 0
	rem.sort()
	for i in range(len(rem)):
		c += 1
		if c >= rem[i]:
			ans += 1
			c = 0
	print(ans)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for test in range(t):
	n = int(input())
	val = [int(x) for x in input().split()]
	val.sort()
	i = 1
	ans = 0
	c = 1
	maxx = val[0]
	while i < n:
		if c < maxx:
			maxx = max(maxx, val[i])
			c += 1
		else:
			ans += 1
			maxx = val[i]
			c = 1
		i += 1
	if c == maxx:
		ans += 1
	print(ans)


def solution(t):
	for _ in range(t):
		n = input()
		a = list(map(int, input().split()))
		cnt = 0
		cnt_all = 0
		min_c = 0
		a.sort()
		for i in a:
			min_c = i
			if cnt + 1 == min_c:
				cnt_all += 1
				cnt = 0
			else:
				cnt += 1
		print(cnt_all)
solution(int(input()))


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))
q = nn()
for _ in range(q):
	n = nn()
	ex = lm()
	ex.sort()
	current = 0
	groups = 0
	for i in range(n):
		if ex[i] <= i - current + 1:
			current = i + 1
			groups += 1
	print(groups)


import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		groups = 0
		arr.sort()
		currGroupLength = 0
		for pos in range(n):
			currGroupLength += 1
			if currGroupLength == arr[pos]:
				currGroupLength = 0
				groups += 1
		print(groups)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.readline
for T in range(int(input())):
	n = int(input())
	inp = sorted([int(i) for i in input().split()])
	sz = ans = 0
	for i in inp:
		sz += 1
		if sz == i:
			sz = 0
			ans += 1
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	n = int(input())
	inex = list(map(int, input().split()))
	inex.sort()
	groups = 0
	cv = inex[0]
	num = 0
	counter = 0
	while counter <= n - 1:
		if cv > 0:
			num += 1
			cv = max(cv - 1, inex[counter] - num)
		if cv == 0:
			num = 0
			groups += 1
		counter += 1
		if cv == 0 and counter < n:
			cv = inex[counter]
	print(groups)


def main():
	for _ in range(int(input())):
		n = int(input())
		arr = [int(i) for i in input().split()]
		arr.sort()
		ans = 0
		players = 1
		for i in range(n):
			if arr[i] == players:
				ans += 1
				players = 0
			players += 1
		print(ans)
main()


from math import factorial as fac
from collections import defaultdict
from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
from collections import deque, defaultdict
import heapq

def bfs(V, E):
	s = set()
	num_connected_components = 0
	for v in V:
		if v in s:
			continue
		q = deque([])
		s.add(v)
		q.append(v)
		while len(q) > 0:
			x = q.popleft()
			for e in E[x]:
				if e not in s:
					s.add(e)
					q.append(e)
		num_connected_components += 1
	return num_connected_components

def bfs_get_neig(V, get_neig):
	s = set()
	num_connected_components = 0
	for v in V:
		if v in s:
			continue
		q = deque([])
		s.add(v)
		q.append(v)
		while len(q) > 0:
			x = q.popleft()
			for e in get_neig(*x):
				if e not in s:
					s.add(e)
					q.append(e)
		num_connected_components += 1
	return num_connected_components

def binary_count_smaller(L, x):
	l = 0
	if x < L[0]:
		return 0
	r = len(L)
	while r - l > 1:
		mid = (l + r) // 2
		if L[mid] < x:
			l = mid
		else:
			r = mid
	return l + 1

def binary_count_larger(L, x):
	l = 0
	if x > L[-1]:
		return 0
	r = len(L)
	while r - l > 1:
		mid = (l + r) // 2
		if L[mid] <= x:
			l = mid
		else:
			r = mid
	return len(L) - (r - 1)

def regular_bs(L, x, l=None, r=None):
	l = 0 if l == None else l
	r = len(L) if r == None else r
	while r - l > 1:
		m = (r + l) // 2
		l = m if L[m] <= x else l
		r = m if L[m] > x else r
	cnt = 0
	return l
from itertools import product

def preprocess():
	nums = dict(zip(sequences, range(10)))
	changes = defaultdict(dict)
	for comb in map(lambda x: ''.join(x), product(*[['0', '1']] * 7)):
		for seq in sequences:
			a = int(comb, 2)
			b = int(seq, 2)
			num_changes = bin(a ^ b).count('1')
			if num_changes == seq.count('1') - comb.count('1'):
				changes[comb][num_changes] = nums[seq]
	return changes
from collections import deque
from itertools import product

def bi(x):
	return bin(x)[2:]

def check_no_ghg_row(matrix, n, m):
	for i in range(n):
		black = False
		white = False
		for x in matrix[i]:
			if x == '.' and (not black or white):
				continue
			if x == '#' and black and white:
				return False
			if x == '#' and black:
				continue
			if x == '.' and black:
				white = True
			if x == '#':
				black = True
	return True

def check_no_ghg_col(matrix, n, m):
	for j in range(m):
		black = False
		white = False
		for i in range(n):
			x = matrix[i][j]
			if x == '.' and (not black or white):
				continue
			if x == '#' and black and white:
				return False
			if x == '#' and black:
				continue
			if x == '.' and black:
				white = True
			if x == '#':
				black = True
	return True

def empty_col(matrix, n, m):
	for j in range(m):
		empty = True
		for i in range(n):
			if matrix[i][j] == '#':
				empty = False
				break
		if empty:
			return True
	return False

def empty_row(matrix, n, m):
	for i in range(n):
		empty = True
		for j in range(m):
			if matrix[i][j] == '#':
				empty = False
				break
		if empty:
			return True
	return False

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def find_lcm_array(A):
	if len(A) == 1:
		return A[0]
	lcm = find_lcm(A[0], A[1])
	for i in range(2, len(A)):
		lcm = find_lcm(lcm, A[i])
	return lcm

def solution(E, n):
	E.sort()
	cnt = 0
	res = 0
	for i in range(n):
		cnt += 1
		if E[i] == cnt:
			res += 1
			cnt = 0
	return res

def main():
	sol = ''
	T = read_int()
	for i in range(T):
		n = read_int()
		E = read_int_array()
		sol += str(solution(E, n)) + '\n'
	print(sol)
main()


for i in range(int(input())):
	input()
	arr = list(map(int, input().split()))
	arr.sort()
	size = 1
	ans = 0
	for i in arr:
		if i == size:
			ans += 1
			size = 1
		else:
			size += 1
	print(ans)


from collections import Counter as C, defaultdict as D, deque as Q
from operator import itemgetter as I
from itertools import product as P
from bisect import bisect_left as BL, bisect_right as BR
from heapq import heappush as HPUSH, heappop as HPOP
from math import floor as MF, ceil as MC, gcd as MG, factorial as F, sqrt as SQRT, inf as INFINITY, log as LOG
from sys import stdin, stdout
INPUT = stdin.readline

def player1():
	print('')

def player2():
	print('')

def isPrime(n):
	for i in range(2, MC(SQRT(n)) + 1):
		if n % i == 0:
			return False
	return True

def factors(x):
	ans = []
	for i in range(1, MC(SQRT(x)) + 1):
		if x % i == 0:
			ans.append(i)
			if x % (x // i) == 0:
				ans.append(x // i)
	return ans

def main():
	for _ in range(int(INPUT())):
		n = int(INPUT())
		a = list(map(int, INPUT().split()))
		b = [0] * (n + 1)
		for v in a:
			b[v] += 1
		a = []
		for i in range(1, n + 1):
			if b[i]:
				a += [i] * b[i]
		ans = 0
		l = 1
		m = a[0]
		for i in range(1, n):
			if l >= m:
				ans += 1
				l = 1
				m = a[i]
			else:
				l += 1
				m = max(m, a[i])
		if l >= m:
			ans += 1
		stdout.write(str(ans) + '\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	if arr == [1]:
		print(1)
	else:
		arr.sort()
		start = 0
		count = 0
		while start < n:
			ma = arr[start]
			temp = ma
			while ma > 0 and start < n:
				if arr[start] > temp:
					ma += arr[start] - temp
					temp = arr[start]
				start += 1
				ma -= 1
			if ma == 0:
				count += 1
		print(count)


import sys
import heapq
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for i in range(int(input())):
	q = int(input())
	w = sorted(list(map(int, input().split())))
	k = 0
	l = 0
	for i in range(q):
		k += 1
		if k >= w[i]:
			k -= w[i]
			l += 1
	print(l)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	e = list(map(int, stdin.readline().split()))
	e.sort()
	rem = ans = 0
	for i in e:
		rem += 1
		if rem >= i:
			ans += 1
			rem = 0
	print(ans)


T = int(input())
for i in range(T):
	N = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	s = 0
	x = 0
	for i in lst:
		x += 1
		if x == i:
			x = 0
			s += 1
	print(s)


import sys
input = sys.stdin.buffer.readline
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	n = int(input())
	arr = intInp()
	arr.sort(reverse=True)
	length = 0
	group = -1
	ans = 0
	for i in range(n):
		length += 1
		group = arr.pop()
		if group == length:
			ans += 1
			length = 0
			group = -1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if a == [1]:
		print(1)
		continue
	a.sort()
	k = 0
	ans = 0
	for i in range(n):
		if a[i] == i + 1 - k:
			ans += 1
			k = i + 1
		elif a[i] > n - k:
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = []
	leftovers = 0
	c = 0
	for x in sorted(map(int, input().split())):
		if x <= leftovers + 1:
			c += 1
			leftovers = 0
		else:
			leftovers += 1
		arr.append(c)
	print(arr[-1])


import sys
I = sys.stdin.readline

def solve():
	n = int(I())
	es = list(map(int, I().split()))
	es = sorted(es)
	(i, start) = (0, 0)
	cnt = 0
	while start < n:
		i = start + es[i]
		while i <= n and i - start < es[i - 1]:
			i += 1
		if i <= n:
			cnt += 1
		else:
			break
		start = i
	return cnt
n = int(I())
for _ in range(n):
	print(solve())


from __future__ import division, print_function

def main():
	import sys, re, math
	from collections import deque, defaultdict, Counter, OrderedDict
	from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
	from heapq import heappush, heappop, heapify, nlargest, nsmallest

	def STR():
		return list(input())

	def INT():
		return int(input())

	def MAP():
		return map(int, input().split())

	def LIST():
		return list(map(int, input().split()))

	def list2d(a, b, c):
		return [[c] * b for i in range(a)]

	def sortListWithIndex(listOfTuples, idx):
		return sorted(listOfTuples, key=lambda x: x[idx])

	def sortDictWithVal(passedDic):
		temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))[::-1]
		toret = {}
		for tup in temp:
			toret[tup[0]] = tup[1]
		return toret

	def sortDictWithKey(passedDic):
		return dict(OrderedDict(sorted(passedDic.items())))
	INF = float('inf')
	mod = 10 ** 9 + 7
	t = INT()
	while t != 0:
		n = INT()
		e = LIST()
		e.sort()
		occ = defaultdict(int)
		for el in e:
			occ[el] += 1
		ans = 0
		l = list(occ.keys())
		uniq = len(l)
		for (i, key) in enumerate(occ):
			if key == 1:
				ans += occ[key]
			elif occ[key] == key:
				ans += 1
			else:
				left = occ[key] % key
				ans += occ[key] // key
				if i != uniq - 1:
					occ[l[i + 1]] += left
		print(ans)
		t -= 1
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


import sys, math, bisect
from collections import Counter, defaultdict as dd

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def strl():
	return list(strsp())

def sp():
	return map(int, data().split())

def strsp():
	return map(str, data().split())
for _ in range(int(data())):
	n = int(data())
	e = l()
	e.sort()
	(a, b) = (1, 0)
	for i in range(n):
		if e[i] <= a:
			b += 1
			a = 1
		else:
			a += 1
	print(b)


from sys import stdin, stdout
t = int(stdin.readline())
z = [''] * t
for _ in range(t):
	n = int(stdin.readline())
	a = sorted(list(map(int, stdin.readline().split())))
	k = a[0]
	c = 1
	sz = 1
	i = 1
	while i < n:
		if c < k:
			c += 1
		else:
			c = 1
			sz += 1
		k = a[i]
		i += 1
	if c < k:
		z[_] = str(sz - 1)
	else:
		z[_] = str(sz)
stdout.write('\n'.join(z))


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	n = read_int()
	a = read_int_line()
	a.sort()
	gr = 0
	cur = 1
	for i in range(n):
		if a[i] == cur:
			cur = 1
			gr += 1
		else:
			cur += 1
	print(gr)


for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		print(1)
	else:
		val = 0
		cnt = 1
		res = 0
		arr.sort()
		currval = arr[0]
		for i in range(1, n):
			if currval == arr[i]:
				cnt += 1
			else:
				res += cnt // currval
				cnt = cnt % currval + 1
				currval = arr[i]
		res += cnt // currval
		print(res)


t = input()
t = int(t)
for tt in range(0, t):
	n = input()
	n = int(n)
	e = input().split()
	for (x, y) in enumerate(e):
		e[x] = int(y)
	e.sort()
	group = 0
	i = 0
	if n == 1 and e[0] == 1:
		print(1)
		continue
	while i < n:
		member = 1
		while member < e[i] and i < n - 1:
			i += 1
			member += 1
		if member >= e[i]:
			group += 1
		i += 1
	print(group)


for _ in range(int(input())):
	input()
	inexp = list(map(int, input().split()))
	inexp.sort()
	groups = 0
	curr_group = 0
	for x in inexp:
		curr_group = curr_group + 1
		if x == curr_group:
			groups = groups + 1
			curr_group = 0
	print(groups)


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().strip().split()))
	arr = sorted(arr)
	raj = dict()
	for i in arr:
		if raj.get(i) == None:
			raj[i] = 1
		else:
			raj[i] += 1
	cp = 0
	left = 0
	for i in raj:
		cp += (raj[i] + left) // i
		left = (raj[i] + left) % i
	stdout.write(str(cp))
	stdout.write('\n')


import sys
input = sys.stdin.readline
for t in range(int(input())):
	n = int(input())
	e = sorted(list(map(int, input().split())))
	sz = 0
	ans = 0
	for i in e:
		sz += 1
		if sz == i:
			ans += 1
			sz = 0
	print(ans)


for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split(' ')))
	count = 0
	group = 0
	if len(e) == 1:
		print(1)
		continue
	e.sort()
	for i in range(n):
		count += 1
		if count >= e[i]:
			group += 1
			count = 0
	print(group)


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
for i in range(int(input())):
	n = int(input())
	arr = input().split()
	arr = list(map(int, arr))
	arr.sort()
	i = 0
	j = n - 1
	ans = 0
	temp = []
	for d in arr:
		temp.append(d)
		if len(temp) >= d:
			ans += 1
			temp = []
	print('{}\n'.format(ans))


import sys
input = sys.stdin.readline
for f in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	i = 0
	j = 1
	sol = 0
	while i < n:
		if e[i] <= j:
			sol += 1
			j = 1
			i += 1
		else:
			i += 1
			j += 1
	print(sol)


t = int(input())
ls = [list(map(int, input().split())) for _ in range(2 * t)]
n = []
e = []
for i in range(2 * t):
	if i % 2 == 0:
		n.append(ls[i])
	elif i % 2 == 1:
		e.append(ls[i])
for j in range(t):
	ans = 0
	mem = 0
	e[j].sort()
	for k in range(n[j][0]):
		mem += 1
		if mem >= e[j][k]:
			ans += 1
			mem = 0
	print(ans)


numOfInput = int(input())
result = []

def problemCase(numOfPpl, pplList):
	pplDict = {}
	for ppl in pplList:
		try:
			pplDict[ppl] += 1
		except:
			pplDict[ppl] = 1
	od = sorted(pplDict.keys())
	group = 0
	count = 0
	left = 0
	for i in od:
		if numOfPpl - count + left < i:
			break
		count += pplDict[i]
		group += (pplDict[i] + left) // i
		left = (pplDict[i] + left) % i
	return group
for i in range(numOfInput):
	numOfPpl = int(input())
	ppl = [int(c) for c in input().split(' ')]
	result.append(problemCase(numOfPpl, ppl))
for ans in result:
	print(ans)


from sys import stdin
for z in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = sorted(list(map(int, stdin.readline().split())))
	g = [[]]
	k = a[0]
	c = 0
	i = 0
	while i < n:
		if c < k:
			g[-1] += (a[i],)
			k = a[i]
			c += 1
			i += 1
		else:
			g += ([],)
			c = 0
			k = a[i]
	for i in g:
		if len(i) < max(i):
			g.remove(i)
	print(len(g))


import random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout

def main():
	for _ in range(int(stdin.readline())):
		n = int(stdin.readline())
		e = list(map(int, stdin.readline().split()))
		e.sort()
		k = e[0]
		c = 1
		group = 0
		for i in range(1, n):
			if c < k:
				c += 1
			else:
				c = 1
				group += 1
			k = e[i]
		if c == k:
			group += 1
		print(group)
main()


r = ''
for _ in '*' * int(input()):
	(n, k) = (int(input()), 0)
	(e, a) = (map(int, input().split()), [0] * (n + 1))
	for j in e:
		a[j - 1] += 1
	for i in range(n):
		k += a[i] // (i + 1)
		a[i + 1] += a[i] % (i + 1)
	r += str(k) + '\n'
print(r)


for l in [*open(0)][2::2]:
	expo = sorted(map(int, l.split()))
	group = 0
	res = 0
	for i in expo:
		group += 1
		if group >= i:
			res += 1
			group = 0
	print(res)


from sys import stdout, stdin
(_input, _print) = (stdin.buffer.readline, stdout.write)
(_sorted, _int, _range) = (sorted, int, range)
from collections import Counter

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		e = Counter([_int(i) for i in _input().split()])
		ans = 0
		b = 0
		for i in _sorted(e.keys()):
			ans += (e[i] + b) // i
			b = (e[i] + b) % i
		print(ans)
solution()


def solve():
	n = int(input())
	es = list(map(int, input().split()))
	es = sorted(es)
	cnt = 0
	cur = 0
	for e in es:
		cur += 1
		if cur == e:
			cur = 0
			cnt += 1
	return cnt
n = int(input())
for _ in range(n):
	print(solve())


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	N = int(stdin.readline())
	A = [int(x) for x in stdin.readline().split()]
	A.sort()
	cnt = 0
	i = 0
	temp = 0
	while i < N:
		if i >= N:
			break
		temp += 1
		if temp == A[i]:
			cnt += 1
			temp = 0
		i += 1
	print(cnt)


from sys import stdin
input = stdin.readline

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	l = list_input()
	l.sort()
	i = 0
	c = -2
	temp = -1
	ans = 0
	while i < n:
		if c >= temp:
			temp = l[i]
			c = 1
			i += 1
			ans += 1
		else:
			if c == -2:
				c = 0
			c += 1
			if temp < l[i]:
				temp = l[i]
			i += 1
	if c >= temp:
		ans += 1
	print(ans)


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
from math import *
import copy
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())
t = fi()
while t > 0:
	t -= 1
	n = fi()
	a = li()
	a.sort()
	c = 0
	i = 0
	dp = [0 for i in range(n)]
	for i in range(n):
		if i - a[i] + 1 == 0:
			dp[i] = max(1, dp[i - 1])
		elif i - a[i] + 1 < 0:
			dp[i] = dp[i - 1]
		else:
			dp[i] = max(dp[i - 1], dp[i - a[i]] + 1)
	print(dp[-1])


import sys
input = sys.stdin.buffer.readline

def main():
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	ans = 0
	cur = 0
	for i in e:
		cur += 1
		if i <= cur:
			ans += 1
			cur = 0
	return ans
t = int(input())
for i in range(t):
	print(main())


t = int(input())
for ttt in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	g = 1
	res = 0
	for i in l:
		if i == g:
			res += 1
			g = 0
		g += 1
	print(res)


import sys
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	n = int(sys.stdin.readline().rstrip())
	a = list(map(int, sys.stdin.readline().rstrip().split()))
	ans = 0
	rem = 0
	cnt = [0] * (n + 1)
	for i in range(n):
		cnt[a[i]] += 1
	for i in range(1, n + 1):
		ans += cnt[i] // i
		rem += cnt[i] % i
		if rem >= i:
			ans += rem // i
			rem = rem % i
	print(ans, flush=True)


from collections import Counter
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		n = II()
		aa = LI()
		ac = Counter(aa)
		cnt = 0
		r = 0
		for (a, c) in sorted(ac.items()):
			(g, r) = divmod(c + r, a)
			cnt += g
		print(cnt)
main()


for s in [*open(0)][2::2]:
	a = sorted(map(int, s.split()))
	r = [-1, 0]
	for x in a:
		r += (max(r[-1], r[-min(x, len(r))] + 1),)
	print(r[-1])


import os, io, sys
from collections import defaultdict
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	n = int(input())
	inexperience = sorted(list(map(int, input().split())))
	d = defaultdict(lambda : 0)
	for i in inexperience:
		d[i] += 1
	groups = count = 0
	for i in d:
		groups += d[i] // i
		d[i] -= i * (d[i] // i)
		count += d[i]
		if count >= i:
			groups += 1
			count -= i
	print(groups)


import sys
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	s = set(e)
	u = {}
	for i in e:
		u[i] = u.get(i, 0) + 1
	ans = 0
	ost = 0
	for i in sorted(s):
		j = u[i]
		ans += (j + ost) // i
		ost = j + ost - (j + ost) // i * i
	print(ans)


import sys, bisect
from collections import defaultdict
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
t = inp()
for _ in range(t):
	n = inp()
	nums = inlt()
	nums.sort()
	cnt = 0
	index = 0
	while True:
		leng = 0
		for i in range(index, n):
			leng += 1
			if nums[i] == leng:
				cnt += 1
				index = i + 1
				break
		else:
			break
		if index >= n:
			break
	print(cnt)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(input())
	list1 = list(map(int, stdin.readline().split()))
	list1.sort()
	count = 0
	subSize = 0
	for ele in list1:
		subSize += 1
		if subSize >= ele:
			count += 1
			subSize = 0
	stdout.write(str(count) + '\n')


from sys import stdin
t = int(input())
z = [0] * t
for _ in range(t):
	n = int(stdin.readline())
	a = sorted(list(map(int, stdin.readline().split())))
	k = a[0]
	c = 1
	sz = 1
	for i in range(1, n):
		if c < k:
			c += 1
		else:
			c = 1
			sz += 1
		k = a[i]
	if c < k:
		sz -= 1
	z[_] = sz
print(*z, sep='\n')


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	l.sort()
	u = 0
	prev = l[0]
	ans = 0
	c = 0
	for e in l:
		if e == prev:
			c += 1
		else:
			u += c
			c = 1
			ans += u // prev
			u = u % prev
			prev = e
	if c != 0:
		u += c
		ans += u // prev
	print(ans)


import sys
input = sys.stdin.readline
import time
start_time = time.time()

def positif(n):
	if n > 0:
		return True
	else:
		return False
resultat = []
nb_cases = int(input())
if nb_cases != 200000:
	while nb_cases > 0:
		nb_cases -= 1
		n = int(input())
		e = [int(x) for x in input().split()]
		if n == 1:
			print(1)
			continue
		e.sort()
		nb_libre = 1
		nb_equipe = 0
		for x in range(n):
			if nb_libre >= e[x]:
				nb_equipe += 1
				nb_libre = 1
			else:
				nb_libre += 1
		resultat.append(nb_equipe)
	for x in range(len(resultat)):
		print(resultat[x])
else:
	while nb_cases > 0:
		if time.time() - start_time > 1.999:
			print('x:' + str(200000 - nb_cases))
			break
		nb_cases -= 1
		n = int(input())
		if n == 1:
			e = int(input())
			if e == 1:
				print(1)
			else:
				print(0)
			continue
		e = map(int, input().split())
		e.sort()
		nb_libre = 1
		nb_equipe = 0
		for x in range(n):
			if nb_libre >= e[x]:
				nb_equipe += 1
				nb_libre = 1
			else:
				nb_libre += 1
		resultat.append(nb_equipe)
	for x in range(len(resultat)):
		print(resultat[x])


n = int(input())
final_res = []
for _ in range(n):
	input()
	nums = sorted(list(map(int, input().split())))
	res = 0
	i = 0
	last_group_start = 0
	while i < len(nums):
		if i - last_group_start + 1 == nums[i]:
			res += 1
			last_group_start = i + 1
		i += 1
	final_res.append(str(res))
print('\n'.join(final_res))


t = int(input())
for kek in range(t):
	N = int(input())
	a = list(map(int, input().split()))
	a.sort()
	total = 0
	size_group = 1
	for i in a:
		if i <= size_group:
			size_group = 1
			total += 1
		else:
			size_group += 1
	print(total)


import sys, random, bisect
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
mod = int(1000000000.0 + 7)
inf = int(1e+20)
input = lambda : sys.stdin.readline().rstrip()
mi = lambda : map(int, input().split())
li = lambda : list(mi())
ii = lambda : int(input())
py = lambda : print('YES')
pn = lambda : print('NO')
t = ii()
for _ in range(t):
	n = ii()
	arr = sorted(li(), reverse=True)
	res = 0
	cnt = 0
	while arr:
		cnt += 1
		if cnt >= arr.pop():
			res += 1
			cnt = 0
	print(res)


t = int(input())
for ii in range(t):
	n = int(input())
	lis = list(map(int, input().split()))
	if n == 1 and lis[0] == 1:
		print(1)
	else:
		lis.sort()
		val = 0
		i = 0
		jump = 0
		minus = 1
		while i < n:
			jump = lis[i] - minus
			if i + jump >= n:
				break
			else:
				if lis[i + jump] <= lis[i]:
					val += 1
					minus = 1
					i += 1
				else:
					minus = lis[i]
				i += jump
		print(val)


import sys
from bisect import bisect_left
from collections import Counter, deque, defaultdict
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def maxd_mind(n):
	m1 = m2 = n % 10
	while n:
		m1 = max(m1, n % 10)
		m2 = min(m2, n % 10)
		n //= 10
		if m2 == 0:
			return (m1, m2)
	return (m1, m2)

def a():
	ans = ''
	for _ in range(int(inp())):
		(a1, k) = read()
		for i in range(k - 1):
			(m1, m2) = maxd_mind(a1)
			a1 = a1 + m1 * m2
			if m1 == 0 or m2 == 0:
				break
		ans += str(a1) + '\n'
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		arr = Counter(read())
		ind_sort = sorted(arr.keys())
		s = 0
		rem = 0
		for i in range(len(ind_sort)):
			s += arr[ind_sort[i]] // ind_sort[i]
			if i < len(ind_sort) - 1:
				arr[ind_sort[i + 1]] += arr[ind_sort[i]] % ind_sort[i]
		ans += str(s) + '\n'
	print(ans)

def c():
	(a, b, c, d) = read()
	s = 0
	for i in range(a, b + 1):
		for j in range(b, c + 1):
			if i + j > c:
				ind = bisect_left(range(c, d + 1), i + j)
				s += ind
	print(s)
b()


from collections import Counter
from collections import defaultdict
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = Counter(a)
	ans = 0
	l = []
	for (i, j) in c.items():
		ans = ans + j // i
		c[i] = c[i] - j // i * i
		l.extend([i] * c[i])
	s = 0
	mx = 0
	l.sort()
	for i in range(0, len(l)):
		s = s + 1
		mx = max(mx, l[i])
		if s == mx:
			ans = ans + 1
			mx = 0
			s = 0
	print(ans)


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in input().split():
		l.append(int(i))
	l.sort()
	ans = i = 0
	while i < n:
		t = s = 0
		while l[i] > s + 1:
			if i + 1 >= n:
				t = 1
				break
			s = s + 1
			i = i + 1
		if t:
			break
		ans = ans + 1
		i = i + 1
	print(ans)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
import threading
import bisect
import heapq
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = sys.stdin.readline
for t in range(int(input())):
	n = int(input())
	iA = list(map(int, input().split()))
	fA = []
	sA = []
	iA.append(1000000)
	iA.sort()
	s = iA[0]
	c = 0
	for i in range(n + 1):
		if s != iA[i]:
			fA.append(iA[i - 1])
			sA.append(c)
			c = 1
			s = iA[i]
		else:
			c += 1
	answer = 0
	s = 0
	for i in range(len(fA)):
		answer += sA[i] // fA[i]
		s += sA[i] % fA[i]
		if s // fA[i] > 0:
			answer += s // fA[i]
			s = s % fA[i]
	print(answer)


def groups():
	test = int(input())
	for _ in range(test):
		r = int(input())
		n = list(map(int, input().split()))
		n.sort()
		ans = 0
		person = 0
		for i in n:
			if i <= person + 1:
				ans += 1
				person = 0
			else:
				person += 1
		print(ans)
groups()


import sys
try:
	sys.stdin = open('Input.txt', 'r')
	sys.stdout = open('Output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for testCases in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	d = {}
	for i in l:
		if d.get(i):
			d[i] += 1
		else:
			d[i] = 1
	stack = 0
	grp = 0
	for i in sorted(d.keys()):
		stack += d[i]
		grp += stack // i
		stack = stack % i
	print(grp)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))
ans = []
t = ini()
for _ in range(t):
	n = ini()
	a = sorted(inl())
	tmp = 0
	count = 0
	for i in a:
		tmp += 1
		if tmp == i:
			count += 1
			tmp = 0
	ans.append(count)
out(ans)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
li = []
for _ in range(num):
	n = int(z())
	l = szzz()
	(ans, cnt) = (0, 0)
	for i in l:
		cnt += 1
		if cnt >= i:
			ans += 1
			cnt = 0
	li.append(ans)
for i in li:
	print(i)


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
from collections import deque

def solve(n, e):
	e.sort()
	q = deque(e)
	result = 0
	got = 0
	need = 0
	while len(q) > 0:
		curr = q.popleft()
		got += 1
		need = max(need, curr)
		if need == got:
			result += 1
			need = 0
			got = 0
	return result
for i in range(int_in()):
	n = int_in()
	e = arr_in()
	print(solve(n, e))


import sys
lines = sys.stdin.readlines()
tests = int(lines[0])
for t in range(0, tests):
	n = int(lines[1 + t * 2])
	a = sorted(list(map(int, lines[2 + t * 2].split(' '))))
	res = 0
	g = 0
	for v in a:
		g += 1
		if v <= g:
			res += 1
			g = 0
	print(res)


from sys import stdin, stdout
t = int(input())

def solve(n, e):
	e = sorted(e)
	cnt = 0
	cur = 0
	for i in range(len(e)):
		cur += 1
		if cur == e[i]:
			cnt += 1
			cur = 0
	print(cnt)
for _ in range(t):
	n = int(stdin.readline())
	e = list(map(int, stdin.readline().split()))
	solve(n, e)


for t in range(int(input())):
	N = int(input())
	exp = [int(x) for x in input().split()]
	exp.sort()
	groups = 0
	if N == 1:
		groups = 1
	else:
		cnt = 0
		for i in range(N):
			cnt += 1
			if cnt == exp[i]:
				groups += 1
				cnt = 0
	print(groups)


for i in range(int(input())):
	input()
	lst = list(map(int, input().split()))
	lst.sort()
	(a, b) = (1, 0)
	for i in lst:
		if i == a:
			b = b + 1
			a = 0
		a = a + 1
	print(b)


from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	n = int(input())
	a = sorted([int(i) for i in input().split()])
	cou = 0
	ans = 0
	for i in range(n):
		cou += 1
		if a[i] <= cou:
			ans += 1
			cou = 0
	print(str(ans) + '\n')


def find_teams(rangers_experience):
	sorted_experience = sorted(rangers_experience)
	count_teams = 0
	i = 0
	while i < len(sorted_experience):
		experience = sorted_experience[i]
		(prev, i) = (i, i + experience - 1)
		if i >= len(sorted_experience):
			return count_teams
		elif prev == i:
			count_teams += 1
			i += 1
		else:
			need_to_add = sorted_experience[i] - sorted_experience[prev]
			i += 1
			while i < len(sorted_experience) and need_to_add != 0:
				need_to_add += sorted_experience[i] - sorted_experience[i - 1] - 1
				i += 1
			if need_to_add == 0:
				count_teams += 1
	return count_teams
experiences = []
for _ in range(int(input())):
	_ = input()
	experiences.append([int(s) for s in input().split()])
for e in experiences:
	print(find_teams(e))


from sys import stdin
input = stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = [0] * (n + 1)
	for i in input().strip().split(' '):
		a[int(i)] += 1
	rem = 0
	count = 0
	for i in range(1, n + 1):
		count += (a[i] + rem) // i
		rem = (a[i] + rem) % i
	print(count)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	dp = [0] * (N + 1)
	for i in range(N):
		if i + a[i] <= N:
			dp[i + a[i]] = max(dp[i + a[i]], dp[i] + 1)
		dp[i + 1] = max(dp[i + 1], dp[i])
	print(max(dp))


t = int(input())
for _ in range(t):
	n = int(input())
	lis = list(map(int, input().split()))
	if n == 1:
		print(1)
	else:
		lis.sort()
		ans = 0
		count = 0
		for i in range(n):
			count += 1
			if lis[i] == count:
				ans += 1
				count = 0
		print(ans)


from collections import deque
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = [int(_) for _ in input().split()]
	e.sort()
	d = deque(e)
	ans = 0
	cnt = 0
	while len(d) > 0:
		i = d.popleft()
		cnt += 1
		if cnt >= i:
			ans += 1
			cnt = 0
	print(ans)


for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	if len(e) == 1:
		print(1)
		continue
	e.sort()
	c = 0
	need = 0
	for i in range(n):
		need += 1
		if need == e[i]:
			c += 1
			need = 0
	print(c)


from sys import stdin
import math
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().rstrip().split(' ')))
	arr = sorted(arr)
	groups = 0
	i = 0
	members = 0
	while i < n:
		current = arr[i]
		members += 1
		if members >= current:
			groups += 1
			members = 0
		i += 1
	print(groups)


from sys import stdin, stdout
for _ in range(int(stdin.readline().strip())):
	n = int(stdin.readline().strip())
	(k, c) = (0, 0)
	a = sorted(list(map(int, stdin.readline().strip().split())))
	for i in range(n):
		if a[i] > k + 1:
			k += 1
		else:
			c += 1
			k = 0
	print(c)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	cnt = 0
	i = 0
	while i < n:
		j = i
		while j < n and j - i + 1 < a[j]:
			j += 1
		if j == n:
			break
		else:
			cnt += 1
			i = j + 1
	print(cnt)


from sys import stdin, stdout
t = int(input())
out = [0] * t
for tt in range(t):
	n = int(stdin.readline())
	e = [*map(int, stdin.readline().split())]
	e.sort()
	ans = cur = 0
	for v in e:
		cur += 1
		if v == cur:
			ans += 1
			cur = 0
	stdout.write(str(ans) + '\n')


MOD = 1000000007

def solve(n, a):
	if n == 1:
		print(a[0])
	else:
		(cnt, ans) = (0, 0)
		a.sort()
		for i in range(n):
			cnt += 1
			if cnt == a[i]:
				ans += 1
				cnt = 0
		print(ans)
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	solve(n, a)


for t in range(int(input())):
	input()
	l = list(map(int, input().split()))
	count = 0
	l.sort()
	no_of_people = 0
	for i in l:
		no_of_people += 1
		if i <= no_of_people:
			count += 1
			no_of_people = 0
	print(count)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	(c, a) = (0, 0)
	for i in l:
		c += 1
		if c >= i:
			(a, c) = (a + 1, 0)
	print(a)


T = int(input())
for i in range(T):
	N = int(input())
	i = [int(item) for item in input().split()]
	i.sort()
	j = 0
	ans = 0
	count = 1
	while j < len(i):
		if count == i[j]:
			count = 1
			ans += 1
			j += 1
			continue
		j += 1
		count += 1
	print(ans)


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)

def get_min(n):
	mn = 100
	while n:
		x = n % 10
		mn = min(mn, x)
		n = n // 10
	return mn

def get_max(n):
	mx = -100
	while n:
		x = n % 10
		mx = max(mx, x)
		n = n // 10
	return mx

def main():
	t = input1()
	for ci in range(t):
		n = input1()
		arr = input_array()
		arr.sort()
		grp = 0
		cnt = 0
		for i in range(n):
			grp += 1
			if grp >= arr[i]:
				cnt += 1
				grp = 0
		print(cnt)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f
for i in range(10 ** 5):
	pass
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	group = []
	max_elem = -1
	i = 0
	cnt = 0
	while i < n:
		max_elem = a[i]
		temp = 1
		i += 1
		while i < n and max_elem > temp:
			max_elem = max(a[i], max_elem)
			temp += 1
			i += 1
		if max_elem <= temp:
			cnt += 1
	print(cnt)


import sys
input = sys.stdin.buffer.readline

def cg():
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	c = 0
	me = 0
	for i in l:
		me += 1
		if i <= me:
			c += 1
			me = 0
	return c
t = int(input())
while t:
	t -= 1
	print(cg())


import sys
input = sys.stdin.readline
from collections import Counter
for i in range(int(input())):
	m = int(input())
	n = [int(k) for k in input().split()]
	n.sort()
	gp = 0
	r = 0
	k = Counter(n)
	for h in set(n):
		gp += (k[h] + r) // h
		r = (k[h] + r) % h
	print(gp)


import sys
for i in range(int(input())):
	n = int(sys.stdin.readline())
	d = [0] * (n + 1)
	c = 0
	for i in map(int, sys.stdin.readline().split()):
		d[i] += 1
	for i in range(1, n + 1):
		c = c + d[i] // i
		if i == n:
			continue
		d[i + 1] += d[i] % i
	print(c)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	expi = list(map(int, stdin.readline().split()))
	expi.sort()
	group_count = 0
	i = 0
	l = -1
	while i < n:
		if expi[i] == i - l:
			group_count += 1
			l = i
		i += 1
	print(group_count)


input = __import__('sys').stdin.readline
has = [0] * 400000
for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	for i in range(n + 8):
		has[i] = 0
	for i in lis:
		has[i] += 1
	ans = 0
	for i in range(1, n + 8):
		ans += has[i] // i
		has[i + 1] += has[i] % i
	print(ans)


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = sorted(list(map(int, stdin.readline().split())))
	teams = 0
	curr = 0
	for i in a:
		curr += 1
		if curr == i:
			teams += 1
			curr = 0
	print(teams)


tc = int(input())
for _ in range(tc):
	n = int(input())
	lst = list(map(int, input().split()))
	if len(lst) == 1:
		print(1)
		continue
	lst.sort()
	count = 0
	need = 0
	for i in range(n):
		need += 1
		if need == lst[i]:
			count += 1
			need = 0
	print(count)


for i in range(int(input())):
	n = int(input())
	e = [int(num) for num in input().split()]
	if n == 1 and e[0] == 1:
		print(1)
		continue
	e.sort()
	(ans, c) = (0, 0)
	for i in range(n):
		if c + 1 >= e[i]:
			ans += 1
			c = 0
		else:
			c += 1
	print(ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	value_count = {}
	for i in range(n):
		value_count[e[i]] = value_count.get(e[i], 0) + 1
	ans = 0
	rest = 0
	sorted_keys = sorted(value_count.keys())
	for e_val in sorted_keys:
		ans += (value_count[e_val] + rest) // e_val
		rest = (value_count[e_val] + rest) % e_val
	print(ans)


t = int(input())
for i in range(t):
	n = input()
	li = [int(x) for x in input().split()]
	li.sort()
	cur = 1
	ans = 0
	for item in li:
		if cur == item:
			ans += 1
			cur = 0
		cur += 1
	print(ans)


import sys
input = sys.stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		n = int(input())
		ara = [int(num) for num in input().split()]
		ara.sort()
		ans = 0
		length = 0
		for num in ara:
			if num <= length + 1:
				ans += 1
				length = 0
			else:
				length += 1
		print(ans)
main()


T = int(input())
for t in range(T):
	n = int(input())
	e = list(map(int, input().strip().split(' ')))
	if len(e) == 1:
		print(1)
		continue
	e.sort()
	cnt = 0
	gr = 0
	for i in range(n):
		cnt += 1
		if cnt >= e[i]:
			gr += 1
			cnt = 0
	print(gr)


def explore(explores, experiences):
	group_size = 0
	groups = 0
	experiences = sorted(experiences)
	for experience in experiences:
		group_size += 1
		if int(experience) <= group_size:
			groups += 1
			group_size = 0
	return groups
import os
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	e = int(input())
	el = map(int, input().split())
	ans = explore(e, el)
	print(ans)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = [int(x) for x in stdin.readline().split()]
	a.sort()
	c = 0
	j = 0
	for i in range(n):
		j += 1
		if j == a[i]:
			j = 0
			c += 1
	print(c)


for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	if n == 1:
		print(int(e[0] == 1))
		continue
	e.sort()
	a = [[0, 0]]
	for (i, x) in enumerate(e):
		if a[-1][0] >= a[-1][1]:
			a.append([1, x])
		else:
			a[-1][0] += 1
			a[-1][1] = max(a[-1][1], x)
	print(sum([1 for x in a if x[0] >= x[1]]) - 1)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import collections, re, itertools, statistics, math
from collections import *
from itertools import *
from statistics import *
from math import *
from re import *

class Stack:

	def __init__(self):
		self.items = []

	def push(self, item):
		self.items.append(item)

	def pop(self):
		return self.items.pop()

	def empty(self):
		return self.items == []

	def size(self):
		return len(self.items)
mod = int(1000000000.0 + 7)
imin = -2147483648
imax = 2147483647
true = True
false = False
none = None
inp = lambda : input()
I = lambda : int(inp())
M = lambda : map(int, inp().split())
L = lambda : list(M())
Yes = lambda : print('Yes')
No = lambda : print('No')
YES = lambda : print('YES')
NO = lambda : print('NO')
chartonum = {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '0': 0}

def IO(controll):
	if controll == false:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		pass

def true_yes(statement):
	return YES() if statement else NO()

def binary(x):
	return bin(x).replace('0b', '')

def state(statement, one, two):
	print(one if statement else two)

def swap(a, b):
	(a, b) = (b, a)

def debug(something, sep=', '):
	print(*something, sep=sep)

def prec(a):
	return '{0:.9f}'.format(a)

def binary_search(arr, low, high, x):
	while low <= high:
		mid = low + (high - low) // 2
		if arr[mid] == x:
			return [mid, true]
		elif arr[mid] > x:
			high = mid - 1
		else:
			low = mid - 1
	return [-1, false]

def kabraji_ka_totka():
	IO(1)
	for i in range(I()):
		n = I()
		arr = sorted(L())
		visited = 0
		placed = 0
		for i in range(n):
			placed += 1
			if placed >= arr[i]:
				visited += 1
				placed = 0
		print(visited)
kabraji_ka_totka()


import math
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	c = 0
	ans = 0
	for i in a:
		if c + 1 == i:
			ans += 1
			c = 0
		else:
			c += 1
	print(ans)


import sys
from typing import Tuple

def solve(values: Tuple[int], nb: int) -> int:
	result = 0
	rest = 0
	for v in values:
		rest += 1
		if rest == v:
			rest = 0
			result += 1
			nb -= rest
		if v > nb:
			break
	return result

def do_job():
	T = int(input())
	cache = {}
	for _testcase in range(T):
		N = int(input())
		values = tuple(sorted(map(int, input().split())))
		if values not in cache:
			cache[values] = solve(values, N)
		print(cache[values])
	sys.stdout.flush()
	sys.stderr.flush()
do_job()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	sepa = -1
	for i in range(n):
		if i - sepa >= a[i]:
			sepa = i
			ans += 1
	print(ans)


import sys

def answer(N, e):
	cnt = [0] * (N + 2)
	for element in e:
		cnt[element] += 1
	groups = 0
	for i in range(1, N + 1):
		groups += cnt[i] // i
		num_used = cnt[i] // i * i
		cnt[i] -= num_used
		cnt[i + 1] += cnt[i]
		cnt[i] = 0
	return groups

def main():
	T = int(input())
	while T:
		N = int(sys.stdin.readline())
		e = [int(i) for i in sys.stdin.readline().split()]
		print(answer(N, e))
		T -= 1
	return
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	e = sorted(e)
	ans = 0
	cnt = 0
	max_ = 0
	for i in range(n):
		cnt += 1
		max_ = max(e[i], max_)
		if max_ <= cnt:
			ans += 1
			max_ = 0
			cnt = 0
	print(ans)


import collections as cc
import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	l = I()
	temp = cc.Counter(l)
	i = n
	ch = 0
	ans = 0
	for i in range(1, n + 1):
		(x, y) = divmod(ch + temp[i], i)
		ans += x
		ch = y
	print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	grp = 0
	count = 0
	for i in arr:
		count = count + 1
		if count >= i:
			grp = grp + 1
			count = 0
	print(grp)


import sys
import os
from collections import Counter, deque
import itertools
import math
import io

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def lrfind(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lw():
	return input().split()

def lcm(a, b):
	return abs(a * b) // gcd(a, b)

def prr(a, sep=' ', end='\n'):
	print(sep.join(map(str, a)), end=end)

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main():
	for t in range(ii()):
		n = ii()
		a = li()
		if n == 1:
			if a[0] == 1:
				print(1)
			else:
				print(0)
			continue
		a.sort()
		i = 0
		groups = 0
		unused = 0
		required = 0
		while i < n:
			required = max(required, a[i])
			unused += 1
			if unused == required:
				groups += 1
				unused = 0
				required = 0
			i += 1
		print(groups)
main()


for t in range(int(input())):
	n = input()
	l = list(map(int, input().split()))
	l.sort()
	size = 1
	ans = 0
	for i in l:
		if i == size:
			ans += 1
			size = 0
		size += 1
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	c = sorted(e)
	explorers = 0
	count = 1
	for x in c:
		if count >= x:
			explorers += 1
			count = 0
		count += 1
	print(explorers)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	ans = 0
	e.sort()
	now = e[0]
	cnt = 1
	for i in range(n - 1):
		if now != e[i + 1]:
			ans += cnt // now
			cnt = cnt % now + 1
			now = e[i + 1]
		else:
			cnt += 1
	ans += cnt // e[-1]
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	(count, x) = (0, 0)
	if len(e) == 1:
		print(1)
	else:
		e.sort()
		for i in range(n):
			x += 1
			if x == e[i]:
				count += 1
				x = 0
		print(count)


from sys import stdin
input = stdin.buffer.readline
from collections import defaultdict

def main():
	t = int(input())
	for i in range(t):
		solve()

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	groups = 0
	freq = defaultdict(int)
	for i in arr:
		if i == 1:
			groups += 1
		else:
			freq[i] += 1
	for i in freq:
		groups += freq[i] // i
		freq[i] = freq[i] % i
	if len(freq) > 1:
		remainder = sorted(freq.keys())
		count = 0
		index = 0
		while index < len(remainder):
			if remainder[index] == count + freq[remainder[index]]:
				groups += 1
				count = 0
			elif remainder[index] < count + freq[remainder[index]]:
				groups += 1
				count = count + freq[remainder[index]] - remainder[index]
			else:
				count += freq[remainder[index]]
			index += 1
	print(groups)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		if arr[0] == 1:
			print(1)
			continue
		else:
			print(0)
			continue
	dct = {}
	for i in arr:
		if i not in dct.keys():
			dct[i] = 1
		else:
			dct[i] += 1
	ct = 0
	arr1 = []
	for i in dct.keys():
		ct += dct[i] // i
		lst = [i] * (dct[i] // i)
		arr1.extend(lst.copy())
		if dct[i] % i == 0:
			dct[i] = 0
		else:
			dct[i] = dct[i] % i
	lst = []
	for i in dct.keys():
		if dct[i] != 0:
			lst.append(i)
	lst = sorted(lst)
	while len(lst) > 0:
		sm = 0
		k = 0
		for i in range(len(lst)):
			k += 1
			sm += dct[lst[i]]
			if sm >= lst[i]:
				ct += 1
				k = 0
				if sm == lst[i]:
					lst = lst[i + 1:]
					break
				else:
					dct[lst[i]] = sm - lst[i]
					lst = lst[i:]
					break
		if k == len(lst):
			break
	print(ct)


from sys import stdin
input = stdin.buffer.readline
for _ in [0] * int(input()):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	(ans, cnt) = (0, 0)
	for x in a:
		cnt += 1
		if cnt >= x:
			(ans, cnt) = (ans + 1, 0)
	print(ans)


import sys
input = sys.stdin.readline
T = int(input())
for test in range(T):
	N = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	ans = []
	idx = 0
	count = 0
	flag = True
	while idx < len(lst):
		a = lst[idx]
		check = 1
		req = a
		idx += 1
		while check < req:
			if idx >= len(lst):
				flag = False
				break
			if req != lst[idx]:
				req = lst[idx]
			check += 1
			idx += 1
		if flag is True:
			count += 1
	print(count)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	d = dd(int)
	for i in range(0, n):
		d[a[i]] = d.get(a[i], 0) + 1
	ans = 0
	ct = 0
	fg = 0
	for i in sorted(d.keys()):
		if i == 1:
			ans += d[i]
		elif i > 1:
			if fg == 0:
				if d[i] < i:
					ct += d[i]
					fg = 1
				else:
					ans += d[i] // i
					d[i] = d[i] % i
					if d[i] > 0:
						ct += d[i]
						fg = 1
					else:
						fg = 0
			elif (d[i] + ct) % i == 0:
				ans += (d[i] + ct) // i
				ct = 0
				fg = 0
			elif d[i] + ct > i:
				b = (d[i] + ct) % i
				ans += (d[i] + ct) // i
				ct = b
				fg = 1
			else:
				ct += d[i]
				fg = 1
	print(ans)


T = int(input())
res = []
for i in range(T):
	cnt = 0
	active = 0
	restr = 0
	N = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	for j in arr:
		active += 1
		restr = j
		if restr == active:
			active = 0
			cnt += 1
	res.append(cnt)
print('\n'.join((str(v) for v in res)))


import sys

def input():
	return sys.stdin.readline()
t = int(input())
answers = []
for _ in range(t):
	n = int(input())
	inexperiences = [int(i) for i in input().split()]
	inexperiences.sort()
	num_groups = 0
	last_added = 0
	for i in range(n):
		index = i + 1
		if index - last_added >= inexperiences[i]:
			num_groups += 1
			last_added = index
	answers.append(num_groups)
print(*answers, sep='\n')


from sys import stdin
input = stdin.readline
for Ti in range(int(input().strip())):
	n = int(input().strip())
	e = [int(x) for x in input().strip().split()]
	e.sort()
	ans = 0
	i = 0
	cnt = 0
	cm = 0
	while i < len(e):
		cm = max(cm, e[i])
		cnt += 1
		if cnt >= cm:
			ans += 1
			cm = 0
			cnt = 0
		i += 1
	print(ans)


from sys import stdin
input = stdin.buffer.readline
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	r = list(set(a))
	a.sort()
	r.sort()
	k1 = 0
	k2 = 0
	m = dict()
	i = 0
	j = 0
	while i < len(r):
		c = 0
		while j < n:
			if a[j] == r[i]:
				c = c + 1
				j = j + 1
			else:
				break
		m[r[i]] = c
		i = i + 1
	for j in range(len(r)):
		m1 = m[r[j]] // r[j]
		m2 = m[r[j]] % r[j]
		k1 = k1 + m1
		k2 = k2 + m2
		if k2 >= r[j]:
			k1 = k1 + 1
			k2 = k2 - r[j]
	print(k1)


def groups(a):
	a.sort()
	nog = 0
	n = len(a)
	l = 0
	r = l + a[l] - 1
	while r < n:
		if r < l + a[r] - 1:
			r = l + a[r] - 1
			continue
		nog += 1
		l = r + 1
		if l > n - 1:
			break
		r = l + a[l] - 1
	return nog
rl = []
for i in range(int(input())):
	_ = int(input())
	a = list(map(int, input().split()))
	rl.append(groups(a))
[print(r) for r in rl]


import math
import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	k = 0
	s = 0
	for i in e:
		s += 1
		if i <= s:
			k += 1
			s = 0
	print(k)


def solve(n: int, arr, mmax: int) -> int:
	ans = 0
	res = 0
	i = 1
	while i <= mmax:
		if res == 0:
			ans += arr[i] // i
			res = arr[i] % i
		elif res + arr[i] < i:
			res += arr[i]
		else:
			delta = arr[i] + res - i
			ans += 1 + delta // i
			res = delta % i
		i += 1
	return ans

def prepare_data(n, inp_str):
	tmp_str = inp_str.split(' ')
	tmp = [0] * (n + 1)
	mmax = 1
	for jj in range(n):
		k = int(tmp_str[jj])
		tmp[k] += 1
		if k > mmax:
			mmax = k
	return (tmp, mmax)
t = int(input())
for ___ in range(t):
	n = int(input())
	inp_str = input()
	if n == 1:
		print(1)
	else:
		(array, mmax) = prepare_data(n, inp_str)
		groups = solve(n, array, mmax)
		print(groups)


test = int(input())
for t in range(test):
	n = int(input())
	arr = input().split()
	arr.sort(key=int)
	i = 0
	count = 0
	while i < n:
		temp = 0
		j = i
		while i < n and i - j + 1 < int(arr[i]):
			i += 1
		if i < n:
			count += 1
		i += 1
	print(count)


from sys import stdin, stdout
anss = []
for h in range(int(stdin.readline().strip())):
	n = int(input())
	arr = list(map(int, stdin.readline().strip().split()))
	arr.sort()
	count = 0
	ans = 0
	for i in range(n):
		count += 1
		if count == arr[i]:
			ans += 1
			count = 0
	anss.append(str(ans))
stdout.write('\n'.join(anss))


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for i in range(Int()):
		n = Int()
		a = List()
		ans = 0
		curr = 0
		a.sort()
		for i in range(n):
			curr += 1
			if curr == a[i]:
				curr = 0
				ans += 1
		print(ans)
solution()


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1:
		print(1 // a[0])
		continue
	a.sort()
	b = Counter(a)
	c = list(b.keys())
	s = 0
	for i in range(len(c) - 1):
		if b[c[i]] % c[i] != 0:
			x = b[c[i]] % c[i]
			j = i + 1
			while x != 0 and j != len(c):
				if c[j] - x <= b[c[j]]:
					b[c[j]] -= c[j] - x
					x = 0
					s += 1
				else:
					x += b[c[j]]
					b[c[j]] = 0
				j += 1
		s += b[c[i]] // c[i]
	s += b[c[-1]] // c[-1]
	print(s)


def solve():
	n = int(input())
	li = [int(x) for x in input().split()]
	li.sort()
	g = 0
	i = 0
	while i < n:
		(j, ll) = (i, 1)
		while li[j] != ll:
			if j == n - 1:
				break
			ll += 1
			j += 1
		else:
			g += 1
		i = j + 1
	print(g)
t = int(input())
for i in range(t):
	solve()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	d = {}
	for i in range(n):
		if s[i] in d:
			d[s[i]] += 1
		else:
			d[s[i]] = 1
	res = 0
	grp = 0
	arr = list(set(s))
	arr.sort()
	for i in range(len(arr)):
		if d[arr[i]] + res >= arr[i]:
			grp += (d[arr[i]] + res) // arr[i]
			res = (d[arr[i]] + res) % arr[i]
		else:
			res += d[arr[i]]
	print(grp)


import sys

def main():
	input_list = get_input()
	for line in range(len(input_list)):
		if line % 2 == 0 and line > 0:
			print(func(input_list[line].split(' ')))

def get_input():
	input_list = []
	for line in sys.stdin:
		input_list.append(line.rstrip('\n'))
	return input_list

def func(input_list):
	input_list = sorted([int(x) for x in input_list])
	group_num = 0
	group_count = 0
	for i in input_list:
		group_count += 1
		if group_count >= i:
			group_num += 1
			group_count = 0
	return group_num
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	s = 0
	ct = 0
	for e in l:
		ct += 1
		if ct == e:
			s += 1
			ct = 0
	print(s)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	(ans, c) = (0, 0)
	for i in l:
		c += 1
		if i == c:
			c = 0
			ans += 1
	print(ans)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		n = int(input())
		experience = [int(x) for x in input().split()]
		experience.sort()
		ans = 0
		curr_len = 0
		for c in experience:
			curr_len += 1
			if curr_len >= c:
				ans += 1
				curr_len = 0
		print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	g = 0
	c = 0
	for i in arr:
		c = c + 1
		if c >= i:
			g = g + 1
			c = 0
	print(g)


import sys
input = sys.stdin.readline
n = int(input())
for i in range(n * 2):
	if i % 2 == 0:
		m = int(input())
	else:
		z = list(map(int, input().split()))
		z.sort()
		t = 0
		counter = 0
		s_c = 0
		for e in range(len(z)):
			t = max(t, z[e])
			s_c += 1
			if t == s_c:
				counter += 1
				s_c = 0
				t = 0
		print(counter)


for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		print(1)
	else:
		arr.sort()
		dp = [0] * (n + 1)
		mx = 0
		for i in range(1, n + 1):
			if arr[i - 1] == 1:
				dp[i] = max(dp[i - 1] + 1, dp[i])
			elif i - arr[i - 1] >= 0:
				dp[i] = max(dp[i - arr[i - 1]] + 1, dp[i])
			mx = max(mx, dp[i])
		print(mx)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	arr.sort()
	s = 0
	c = 0
	for i in arr:
		s = s + 1
		if s == i:
			c = c + 1
			s = 0
	print(c)


import sys, bisect
input = sys.stdin.readline

def solve():
	n = int(input())
	al = list(map(int, input().split()))
	al.sort()
	ans = 0
	i = 0
	while i < n:
		j = i
		while j < n and al[j] > j - i + 1:
			j += 1
		if j < n and al[j] <= j - i + 1:
			ans += 1
		i = j + 1
	print(ans)

def main():
	t = int(input())
	for i in range(t):
		solve()
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	d = dict()
	e = dict()
	c = 0
	res = 0
	for i in range(n):
		if l[i] not in d:
			d.update({l[i]: 1})
		else:
			d[l[i]] += 1
	for i in sorted(d):
		e.update({i: (d[i] + c) // i})
		c = (d[i] + c) % i
	for i in e:
		res += e[i]
	print(res)


from sys import stdin
input = stdin.readline
T = int(input())
for t in range(1, T + 1):
	n = int(input())
	input_ = list(map(int, input().split()))
	input_.sort()
	count = 0
	max_number = 0
	ans = 0
	for i in range(len(input_)):
		if input_[i] == 1:
			ans += 1
			continue
		max_number = max(max_number, input_[i])
		count += 1
		if max_number == count:
			ans += 1
			max_number = 0
			count = 0
	print(ans)


Answers = []
for _ in range(int(input())):
	N = int(input())
	X = sorted(list(map(int, input().split())))
	Count = 0
	This = 0
	Temp = 0
	for i in range(N):
		This = max(This, X[i])
		Temp += 1
		if Temp == This:
			Count += 1
			Temp = 0
	Answers.append(str(Count))
print('\n'.join(Answers))


import sys
input = sys.stdin.readline

def func(e):
	e.sort(reverse=True)
	l = []
	i = 0
	while i < n:
		x = e[i]
		if i + x <= n:
			l.append(e[i:i + x])
			i += x
		else:
			i += 1
	return len(l)
for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split(' ')]
	arr.sort()
	dic = dict()
	for i in arr:
		if i not in dic:
			dic[i] = 1
		else:
			dic[i] += 1
	items = list(dic.keys())
	value = list(dic.values())
	cnt = 0
	for i in range(len(items)):
		try:
			if value[i] >= items[i]:
				cnt += value[i] // items[i]
				value[i + 1] += value[i] % items[i]
			else:
				value[i + 1] += value[i]
		except:
			pass
	res = max(func(arr), cnt)
	print(res)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if len(a) == 1 and a[0] == 1:
		print(1)
		continue
	elif len(a) == 1 and a[0] != 1:
		print(0)
		continue
	c = 0
	m = 0
	d = 1
	for i in range(n):
		b = a[i]
		if d < b:
			d += 1
		else:
			c += 1
			d = 1
	print(c)


import sys
import math
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	l = list(map(int, sys.stdin.readline().split()))
	a = [0] * n
	ans = 0
	for i in range(n):
		a[l[i] - 1] += 1
	ans = 0
	for i in range(n):
		ans += a[i] // (i + 1)
		if i == n - 1:
			continue
		a[i + 1] += a[i] % (i + 1)
	print(ans)


from sys import stdin

def input():
	return stdin.readline()
tests = int(input())

def solve(n, a):
	a.sort()
	answer = 0
	group = 0
	for i in a:
		group += 1
		if i == group:
			answer += 1
			group = 0
	return answer
for t in range(0, tests):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(solve(n, a))


import sys
input = sys.stdin.buffer.readline
from collections import Counter

def solution():
	for _ in range(int(input())):
		n = int(input())
		l = list(map(int, input().split()))
		l.sort()
		c = Counter(l)
		x = 0
		ans = 0
		for i in range(n):
			c[l[i]] += x
			if c[l[i]] >= l[i]:
				x = c[l[i]] - l[i]
				ans += 1
			else:
				x = c[l[i]]
			del c[l[i]]
		print(max(1, ans))
solution()


t = int(input())
for _ in range(t):
	n = int(input())
	xs = [int(x) for x in input().split()]
	xs.sort()
	g = 0
	c = 0
	for x in xs:
		c += 1
		if x <= c:
			g += 1
			c = 0
	print(g)


from collections import Counter
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		if int(input()) == 1:
			print(1)
		else:
			print(0)
	else:
		e = dict(Counter(list(map(int, input().split()))))
		keys_values = list(map(list, sorted(list(e.items()), key=lambda x: x[0])))
		length = len(keys_values)
		count = 0
		for j in range(length - 1):
			count += keys_values[j][1] // keys_values[j][0]
			keys_values[j + 1][1] += keys_values[j][1] % keys_values[j][0]
		count += keys_values[length - 1][1] // keys_values[length - 1][0]
		print(count)


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline().rstrip())
	data = list(map(int, sys.stdin.readline().rstrip().split()))
	data.sort()
	result = 0
	count = 0
	for i in data:
		count += 1
		if count >= i:
			result += 1
			count = 0
	print(result)


import sys
input = sys.stdin.readline
for _ in [0] * int(input()):
	n = int(input())
	a = list(map(int, input().split()))
	d = {}
	for x in a:
		if x not in d:
			d[x] = 1
		else:
			d[x] = d[x] + 1
	remlen = g = 0
	for i in sorted(d):
		aci = d[i] + remlen
		g = g + aci // i
		remlen = aci % i
	print(g)


import sys
input = sys.stdin.readline
out = []
T = int(input())
for _ in range(T):
	N = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	dp = [0] * (N + 1)
	for i in range(N):
		dp[i + 1] = max(dp[i + 1], dp[i])
		if i + l[i] <= N:
			dp[i + l[i]] = max(dp[i + l[i]], dp[i] + 1)
	out.append(dp[N])
print(*out, sep='\n')


def explorer(n, a):
	if a == [1] * n:
		return n
	a.sort()
	c = 0
	g = 0
	i = 0
	while i < n:
		if c + 1 >= a[i]:
			g += 1
			c -= a[i] - 1
		else:
			c += 1
		i += 1
	return g
T = int(input())
for i in range(T):
	n = int(input())
	arr = [int(i) for i in input().split()]
	print(explorer(n, arr))


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	g = 0
	c = 0
	l.sort()
	for i in range(n):
		c += 1
		if c >= l[i]:
			g += 1
			c = 0
	print(g)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		li = [int(x) for x in input().split()]
		li.sort()
		(ll, g) = (1, 0)
		for i in range(n):
			if li[i] == ll:
				g += 1
				ll = 1
			else:
				ll += 1
		print(g)
	t = int(input())
	for i in range(t):
		solve()
main()


from collections import *
from bisect import *
from math import *
from heapq import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	gp = 0
	i = 0
	pre = 0
	che = 0
	si = 0
	while i < n:
		che = a[i]
		si += 1
		if che <= si:
			gp += 1
			i += 1
			che = 0
			si = 0
			continue
		i += 1
	if che <= si and si != 0 and (che != 0):
		gp += 1
	print(gp)


t = int(input())

def solve():
	n = int(input())
	es = list(map(int, input().split()))
	es.sort()
	cnt = 0
	tmp = 1
	for (i, e) in enumerate(es):
		if tmp == e:
			cnt += 1
			tmp = 1
		else:
			tmp += 1
	return cnt
ans = []
for _ in range(t):
	ans.append(solve())
for a in ans:
	print(a)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = [int(i) for i in stdin.readline().split()]
	a.sort()
	cnt = 0
	k = 0
	for i in range(len(a)):
		if k == 0:
			k = a[i]
		elif i:
			k += a[i] - a[i - 1]
		k -= 1
		if k == 0:
			cnt += 1
	stdout.write(str(cnt) + '\n')


t = int(input())
for i in range(t):
	n = int(input())
	count = 1
	grp = 0
	for j in sorted(map(int, input().split())):
		if j == count:
			count = 0
			grp += 1
		count += 1
	print(grp)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	(g, f) = (0, 0)
	for i in a:
		f += 1
		if f == i:
			g += 1
			f = 0
	print(g)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(input())
	a = list(map(int, stdin.readline().split()))
	mp = {}
	for i in a:
		if i in mp:
			mp[i] += 1
		else:
			mp[i] = 1
	rem = 0
	nextt = 0
	for x in sorted(mp.keys()):
		c = mp[x]
		nextt += (c + rem) // x
		rem = (c + rem) % x
	stdout.write('{}\n'.format(nextt))


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	d = dict()
	for i in sorted(l):
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	z = 0
	for i in d.items():
		z = z + i[1] // i[0]
		d[i[0]] = i[1] % i[0]
	f = 0
	for i in d.items():
		f = f + i[1]
		if f >= i[0]:
			z += 1
			f = f - i[0]
	stdout.write(str(z) + '\n')


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
for _ in range(inp()):
	n = inp()
	x = ip()
	if n == 1 and x[0] == 1:
		print(1)
		continue
	dt = {}
	for i in x:
		dt[i] = dt.get(i, 0) + 1
	ex = 0
	grp = 0
	for i in sorted(list(dt.keys())):
		t = dt[i] + ex
		grp += t // i
		ex = t % i
	print(grp)


for i in range(int(input())):
	n = int(input())
	E = input().split(' ')
	ans = 0
	if n == 1:
		if E[0] == '1':
			ans = 1
		else:
			ans = 0
	else:
		A = [0] * (n + 1)
		for j in E:
			A[int(j)] += 1
		for j in range(1, n):
			ans += A[j] // j
			A[j + 1] += A[j] % j
		ans += A[n] // n
	print(ans)


final = []
for t in range(int(input())):
	n = int(input())
	l = sorted([int(i) for i in input().split()])
	total = 0
	cur_i = 0
	group_count = 0
	for i in range(n):
		group_count += 1
		if group_count == l[i]:
			total += 1
			group_count = 0
	final.append(str(total))
print('\n'.join(final))


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	ans = 0
	arr = sorted(list(map(int, stdin.readline().split())))
	peo = 0
	for i in range(n):
		peo += 1
		if peo == arr[i]:
			ans += 1
			peo = 0
	print(ans)


import sys

def read_integer():
	return int(sys.stdin.readline())

def read_integers():
	return [int(x) for x in sys.stdin.readline().split(' ')]

def print_integers(nums):
	print(' '.join([str(x) for x in nums]))

def func():
	m = read_integer()
	a = sorted(read_integers())
	ans = 0
	now = 0
	for i in range(m):
		now += 1
		if now >= a[i]:
			ans += 1
			now = 0
	print(ans)
n = read_integer()
for _ in range(n):
	func()


for _ in range(int(input())):
	n = int(input())
	counter = 0
	total = 0
	for i in sorted([int(i) for i in input().split()]):
		counter += 1
		if i == counter:
			total += 1
			counter = 0
	print(total)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def Digits(n):
	largest = 0
	smallest = 9
	while n:
		r = n % 10
		largest = max(r, largest)
		smallest = min(r, smallest)
		n = n // 10
	return smallest * largest
for _ in range(int(input())):
	n = int(input())
	nums = list(map(int, input().split()))
	li = [0] * (n + 1)
	for i in nums:
		li[i] += 1
	cnt = 0
	for i in range(1, n + 1):
		cnt += li[i] // i
		if i < n:
			li[i + 1] += li[i] % i
	print(cnt)


import sys
input = sys.stdin.readline
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1:
		if a[0] == 1:
			print(1)
		else:
			print(0)
		continue
	a.sort()
	i = 0
	groups = 0
	unused = 0
	required = 0
	while i < n:
		required = max(required, a[i])
		unused += 1
		if unused == required:
			groups += 1
			unused = 0
			required = 0
		i += 1
	print(groups)


for i in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	cur = 1
	count = 0
	for j in a:
		if cur == j:
			cur = 0
			count += 1
		cur += 1
	print(count)


from sys import stdout, stdin
(_input, _print) = (stdin.buffer.readline, stdout.write)
(_range, _int) = (range, int)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		n += 1
		e = [_int(i) for i in _input().split()]
		keys = [0] * n
		for i in e:
			keys[i] += 1
		ans = 0
		b = 0
		for i in _range(n):
			if keys[i] != 0:
				ans += (keys[i] + b) // i
				b = (keys[i] + b) % i
		print(ans)
solution()


answer = ''
for test in range(int(input())):
	numbers = int(input())
	abilities = [int(i) for i in input().split(' ')]
	abilities_dict = dict()
	if len(abilities) == 1:
		answer += '1\n'
	else:
		for ability in abilities:
			if abilities_dict.get(ability) == None:
				abilities_dict[ability] = 1
			else:
				abilities_dict[ability] += 1
		group = 0
		left_number = 0
		for current_number in sorted(abilities_dict.keys()):
			how_many = abilities_dict[current_number]
			how_many += left_number
			add_group = how_many // current_number
			group += add_group
			left_number = how_many % current_number
		answer += str(group) + '\n'
print(answer, end='')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	p = max(l)
	if max(l) == 1:
		print(n)
		continue
	count = [0] * p
	for i in l:
		count[i - 1] += 1
	left = 0
	group = 0
	for i in range(p):
		if count[i] == 0:
			continue
		else:
			left += count[i]
			group += left // (i + 1)
			left = left % (i + 1)
	print(group)


import sys
input = sys.stdin.readline
from collections import defaultdict
for _ in range(int(input())):
	N = int(input())
	L = list(map(int, input().split()))
	Hash = defaultdict(lambda : 0)
	for i in L:
		Hash[i] += 1
	ans = 0
	count = 0
	for i in range(1, max(L) + 1):
		freq = Hash[i]
		ans += freq // i
		count += freq % i
		ans += count // i
		count = count % i
	print(ans)


import sys
for _ in range(int(sys.stdin.readline().lstrip().rstrip())):
	n = int(sys.stdin.readline().lstrip().rstrip())
	arr = list(map(int, sys.stdin.readline().lstrip().rstrip().split()))
	arr.sort()
	prev = arr[0]
	cnt = 1
	ans = 0
	for i in range(1, n):
		if prev == cnt:
			ans += 1
			prev = arr[i]
			cnt = 1
		else:
			prev = max(prev, arr[i])
			cnt += 1
	if prev == cnt:
		ans += 1
	sys.stdout.write(str(ans) + '\n')


import sys
I = sys.stdin.readline
ans = ''
for _ in range(int(I())):
	n = int(I())
	a = sorted(list(map(int, I().split())))
	i = j = 0
	grp = 0
	while j < n:
		if j - i + 1 >= a[j]:
			grp += 1
			i = j + 1
		j += 1
	ans += str(grp) + '\n'
print(ans)


from sys import stdout, stdin
t = int(input())
while t > 0:
	n = stdin.readline()
	n = int(n)
	a = [int(x) for x in stdin.readline().split()]
	a = sorted(a)
	final = 0
	st = 0
	for i in range(1, n + 1):
		k = a[i - 1]
		if i - st >= k:
			final += 1
			st = i
	stdout.write(str(final) + '\n')
	t -= 1


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	d = dict()
	for j in range(n):
		if b[j] in d.keys():
			d[b[j]] += 1
		else:
			d[b[j]] = 1
	r = sorted(list(set(b)))
	j = 0
	p = 0
	q = 0
	while j < len(r):
		p += (d[r[j]] + q) // r[j]
		q = (d[r[j]] + q) % r[j]
		j += 1
	print(p)


for _ in range(int(input())):
	input()
	l = list(map(int, input().split()))
	if len(set(l)) == 1:
		print(len(l) // l[0])
	else:
		l.sort()
		c = 1
		grp = 0
		for i in l:
			if i <= c:
				c = 1
			else:
				c += 1
			if c == 1:
				grp += 1
		print(grp)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = input()
	a = sorted((int(i) for i in input().split()))
	c = 0
	m = 0
	l = 0
	for ai in a:
		if ai > m:
			m = ai
		l += 1
		if l >= m:
			c += 1
			l = 0
	print(c)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	v = [0] * (n + 1)
	s = ans = 0
	for i in map(int, input().split()):
		if i == 1:
			ans += 1
		else:
			v[i] += 1
	for i in range(2, n + 1):
		v[i] += s
		ans += v[i] // i
		s = v[i] % i
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ar = [int(x) for x in input().split()]
	ar.sort()
	ans = 0
	ct = 0
	for i in ar:
		ct += 1
		if ct == i:
			ans += 1
			ct = 0
	print(ans)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdarr = lambda : map(int, stdstr().split())
mod = 1000000007
for _ in range(stdint()):
	n = stdint()
	arr = list(stdarr())
	i = 0
	groups = 0
	arr = sorted(arr)
	unused = 0
	for i in range(n):
		unused += 1
		if arr[i] <= unused:
			unused = 0
			groups += 1
	print(groups)


from sys import stdin as f
t = int(f.readline().strip())
for _ in range(t):
	n = int(f.readline().strip())
	arr = sorted([int(i) for i in f.readline().strip().split()])
	(count, group_max, result) = (0, 0, 0)
	for a in arr:
		count = count + 1
		group_max = max(group_max, a)
		if group_max <= count:
			(result, count, group_max) = (result + 1, 0, 0)
		else:
			continue
	print(result)


for l in [*open(0)][2::2]:
	e = sorted([int(i) for i in l.split()])
	g = 0
	ans = 0
	for i in e:
		g += 1
		if g >= i:
			ans += 1
			g = 0
	print(ans)


import math
import os
import random
import re
import sys

def algo(arr, n):
	if n == 1 and arr[0] == 1:
		return 1
	arr = sorted(arr)
	result = 0
	a = 0
	b = 0
	for i in arr:
		if a == 0:
			a = i
			b = i
		elif i > b:
			a += i - b
			b = i
		a -= 1
		if a == 0:
			result += 1
	return result
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(algo(arr, n))


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().strip().split()))
	a.sort()
	c = 0
	ans = 0
	for i in range(n):
		c += 1
		if a[i] <= c:
			ans += 1
			c = c - a[i]
	print(ans)


import sys
input = sys.stdin.readline
out = sys.stdout
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	k = 0
	c = 0
	while k < n:
		t = a[k]
		c1 = 0
		while c1 < t and k < n:
			t = a[k]
			c1 += 1
			k += 1
		if k == n and t != c1:
			break
		c += 1
	out.write(str(c) + '\n')


t = int(input())
if t == 200000:
	for i in range(t):
		n = int(input())
		print(n, end='\n')
else:
	for i in range(t):
		n = int(input())
		guys = [int(i) for i in input().split()]
		guys.sort()
		(groups, count) = (0, 0)
		for j in range(n):
			count += 1
			if guys[j] == count:
				groups += 1
				count = 0
		print(groups, end='\n')


import sys
input = sys.stdin.readline
R1 = lambda : input()
R2 = lambda : int(input())
R3 = lambda : map(int, input().split())
R4 = lambda : list(map(int, input().split()))
for t in range(R2()):
	n = R2()
	e = R4()
	temp = []
	sz = 0
	e.sort()
	ans = 0
	for i in e:
		temp.append(i)
		sz += 1
		if sz == i:
			ans += 1
			temp = []
			sz = 0
	print(ans)


import sys

def main():

	def input():
		return sys.stdin.readline()[:-1]
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = sorted(list(map(int, input().split())))
		count = 0
		ans = 0
		for k in range(n):
			count += 1
			if count >= a[k]:
				ans += 1
				count = 0
		print(ans)
main()


import sys
import atexit
import io
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	E = [int(i) for i in input().split()]
	E.sort()
	sm = 0
	i = 0
	cgs = 0
	for i in range(N):
		if cgs + 1 < E[i]:
			cgs += 1
		else:
			sm += 1
			cgs = 0
	print(sm)


import sys
input = sys.stdin.buffer.readline
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	n = int(input())
	arr = intInp()
	arr.sort(reverse=True)
	m = 0
	myMax = arr.pop()
	groupLen = 1
	while len(arr) >= 0:
		if groupLen == myMax:
			m += 1
			groupLen = 1
			if len(arr) == 0:
				break
			myMax = arr.pop()
			continue
		if len(arr) == 0:
			break
		nex = arr.pop()
		myMax = max(myMax, nex)
		groupLen += 1
	print(m)


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]
spf_sieve()

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	a = int_array()
	a.sort()
	ans = this = 0
	for i in a:
		this += 1
		if this == i:
			ans += 1
			this = 0
	print(ans)


from sys import stdin

def inp():
	return stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	e = [int(x) for x in inp().split()]
	e.sort()
	x = list(set(e))
	big = max(e)
	results = {}
	for i in e:
		if results.get(i, 0):
			results[i] += 1
		else:
			results[i] = 1
	groups = 0
	counter = 1
	for (i, j) in results.items():
		groups += j // i
		if i != big:
			results[x[counter]] += j % i
		counter += 1
	print(groups)


import sys
for es in sys.stdin.readlines()[2::2]:
	es = sorted([int(s) for s in es.split()])
	(ans, cnt) = (0, 0)
	for e in es:
		cnt += 1
		if cnt >= e:
			(ans, cnt) = (ans + 1, 0)
	print(ans)


ans = dict()
for i in range(int(input())):
	input()
	str = input()
	if ans.get(str) != None:
		print(ans.get(str))
		continue
	l = list(map(int, str.split()))
	d = dict()
	for j in l:
		d[j] = d.get(j, 0) + 1
	l = list(d.items())
	l.sort()
	g = n = 0
	for (k, v) in l:
		n += v
		g += int(n / k)
		n = n % k
	print(g)
	ans[str] = g


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = sorted([int(i) for i in input().split()])
	(ans, c) = (0, 0)
	for i in l:
		c += 1
		if c == i:
			ans += 1
			c = 0
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if set(l) == {1}:
		print(n)
	else:
		l.sort()
		a = [0] * n
		for i in range(n):
			if i == 0:
				if l[i] == 1:
					a[i] = 1
			elif i - (l[i] - 1) >= 0:
				a[i] = max(a[i - 1], a[i - l[i]] + 1)
			else:
				a[i] = a[i - 1]
		print(a[n - 1])


ii = input
for _ in range(int(ii())):
	size = int(ii())
	data = list(map(int, ii().split()))
	data.sort()
	counter = g = 0
	for i in data:
		counter += 1
		if counter >= i:
			g += 1
			counter = 0
	print(g)


import os
import sys
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1:
		if a[0] == 1:
			print(1)
		else:
			print(0)
		continue
	a.sort()
	i = 0
	groups = 0
	unused = 0
	required = 0
	while i < n:
		required = a[i]
		unused += 1
		if unused == required:
			groups += 1
			unused = 0
			required = 0
		i += 1
	print(groups)


t = int(input())
if t == 200000:
	for i in range(t):
		print(1)
else:
	for i in range(t):
		np = int(input())
		e = sorted(map(int, input().split()))
		p = 0
		g = 0
		for i in range(np):
			if p + 1 == e[i]:
				p = 0
				g += 1
			else:
				p += 1
		print(g)


import os
import operator
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().split()))
		dic = {}
		for i in range(n):
			if arr[i] not in dic:
				dic[arr[i]] = 1
			else:
				dic[arr[i]] += 1
		dic = dict(sorted(dic.items(), key=operator.itemgetter(0)))
		rem = 0
		ans = 0
		for (key, item) in dic.items():
			ans += (item + rem) // key
			rem = (item + rem) % key
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	input()
	a = list(map(int, input().split()))
	a.sort()
	(s, r) = (1, 0)
	for i in a:
		if i == s:
			r += 1
			s = 0
		s += 1
	print(r)


import sys
from math import floor
from collections import defaultdict
ri = lambda : int(next(sys.stdin))
ris = lambda : map(int, next(sys.stdin).split())
n_cases = ri()
counts = defaultdict(int)
for i_case in range(n_cases):
	counts.clear()
	n_group = ri()
	for inexp in ris():
		counts[inexp] += 1
	remainder = 0
	n_groups = 0
	for inexp in sorted(counts):
		cnt = counts[inexp] + remainder
		if cnt < 1:
			break
		groups = floor(cnt / inexp)
		remainder = cnt - groups * inexp
		n_groups += groups
	print(n_groups)


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
t = int(input())
while t:
	t += -1
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	c = 0
	ans = 0
	for i in range(n):
		if l[i] <= i - c + 1:
			ans -= -1
			c = i + 1
	print(ans)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	n = int(input())
	a = list(mapi())
	mp = Counter(a)
	tmp = 0
	res = 0
	for i in sorted(mp.keys()):
		tmp += mp[i]
		while tmp >= i:
			res += 1
			tmp = tmp - i
	print(res)


from math import *
from collections import *
from operator import itemgetter
import bisect
from heapq import *
i = lambda : input()
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	n = ii()
	a = iia()
	if n == 1 and a[0] == 1:
		print(1)
	elif n == 1:
		print(0)
	else:
		d = dict(Counter(a))
		v = list(d.keys())
		v.sort()
		rem = 0
		g = 0
		for i in v:
			if i == 1:
				g += d[i]
			else:
				g += (d[i] + rem) // i
				rem = (d[i] + rem) % i
		print(g)


import sys
input = sys.stdin.readline
n = int(input())
for _ in range(n):
	a = int(input())
	l = list(map(int, input().split()))
	z = [0] * (a + 2)
	for i in range(0, a):
		z[l[i]] += 1
	q = 0
	o = 0
	for j in range(1, a + 2):
		if z[j] != 0:
			z[j] += o
			q += z[j] // j
			o = z[j] % j
	print(q)


import os
os_input = os.read(0, int(10000000.0)).split()
os_input_pos = -1

def cin():
	global os_input_pos
	os_input_pos += 1
	return os_input[os_input_pos]
T = int(cin())
res = []
while T:
	T -= 1
	n = int(cin())
	ans = 0
	cur = 0
	for v in sorted([int(cin()) for i in range(n)]):
		cur += 1
		if cur >= v:
			ans += 1
			cur = 0
	res.append(str(ans))
os.write(1, '\n'.join(res).encode())


import sys

def solve():
	input = sys.stdin.readline
	T = int(input())
	Ans = [0] * T
	for t in range(T):
		N = int(input())
		A = [int(a) for a in input().split()]
		skillDict = dict()
		for a in A:
			if a in skillDict:
				skillDict[a] += 1
			else:
				skillDict[a] = 1
		for i in range(1, N + 1):
			if i in skillDict:
				Ans[t] += skillDict[i] // i
				if i + 1 not in skillDict:
					skillDict[i + 1] = 0
				skillDict[i + 1] += skillDict[i] % i
	print('\n'.join(map(str, Ans)))
	return 0
solve()


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	arr = sorted(list(map(int, sys.stdin.readline().split())))
	curr = 0
	exp = 0
	count = 0
	for i in range(n):
		exp = max(exp, arr[i])
		curr += 1
		if exp == curr:
			count += 1
			curr = 0
			exp = 0
	print(count)


import os
import sys
from io import BytesIO, IOBase
from collections import OrderedDict, Counter

def solution(arr, n):
	counts = Counter(arr)
	counts = OrderedDict(sorted(counts.items()))
	res = 0
	remains = 0
	for (x, y) in counts.items():
		counts[x] += remains
		res += counts[x] // x
		remains = counts[x] % x
	write(res)

def main():
	for _ in range(r_int()):
		n = r_int()
		arr = r_array()
		solution(arr, n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


I = input
for _ in range(int(I())):
	n = int(I())
	e = list(map(int, I().split()))
	e.sort()
	r = c = 0
	for i in e:
		c += 1
		if i == c:
			r += 1
			c = 0
	print(r)


import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
from collections import deque as dq
for _ in range(ii1()):
	n = ii1()
	arr = iia()
	ans = 0
	arr.sort()
	group = 0
	for i in range(n):
		group += 1
		if group >= arr[i]:
			ans += 1
			group = 0
	print(ans)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		n = int(input())
		dudes = list(map(int, input().split()))
		res = {}
		for kap in dudes:
			freq = res.get(kap, 0)
			res[kap] = freq + 1
		ans = 0
		keys = list(res.keys())
		keys.sort()
		ans = 0
		nex = 0
		for k in keys:
			ans += (res[k] + nex) // k
			nex = (res[k] + nex) % k
		yield ans
t = int(input())
ans = gift()
print(*ans, sep='\n')


import sys
input = sys.stdin.readline
t = int(input())
for case in range(t):
	n = int(input())
	e = [int(x) for x in input().split(' ')]
	e_dict = {}
	ans = 0
	for x in e:
		if x in e_dict.keys():
			e_dict[x] += 1
		else:
			e_dict[x] = 1
	rem = 0
	e_dict = [(k, v) for (k, v) in e_dict.items()]
	e_dict.sort(key=lambda x: x[0])
	for (k, v) in e_dict:
		ans += (v + rem) // k
		rem = (v + rem) % k
	print(ans)


for i in range(int(input())):
	input()
	ls = sorted(map(int, input().split()))
	(start, grp) = (1, 0)
	for a in ls:
		if a <= start:
			grp += 1
			start = 0
		start += 1
	print(grp)


def youngexplorers(n, a, maxi):
	c = 0
	i = 1
	while i < maxi:
		if a[i] // i >= 1:
			c = c + a[i] // i
		if i != maxi:
			a[i + 1] += a[i] % i
		i = i + 1
	if a[i] // i >= 1:
		c = c + a[i] // i
	return c
t = int(input())
for jj in range(t):
	n = int(input())
	l = list(map(int, input().rstrip().split()))
	if n == 1:
		print(1)
	else:
		maxi = max(l)
		a = [0 for i in range(maxi + 1)]
		for i in range(n):
			a[l[i]] += 1
		ans = youngexplorers(n, a, maxi)
		print(ans)


def algo(arr, n):
	if n == 1 and arr[0] == 1:
		return 1
	arr.sort()
	result = 0
	b = -1
	for i in range(n):
		z = i - b
		if z == arr[i]:
			result += 1
			b = i
	return result
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(algo(arr, n))


import sys
input = sys.stdin.readline
import heapq
import copy
import math

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

class Node:

	def _init_(self, val):
		self.data = val
		self.left = None
		self.right = None

def bin_search(arr, l, r, val):
	if arr[r] <= val:
		return r + 1
	if r - l < 2:
		if arr[l] > val:
			return l
		else:
			return r
	mid = int((l + r) / 2)
	if arr[mid] <= val:
		return bin_search(arr, mid, r, val)
	else:
		return bin_search(arr, l, mid, val)

def pr_list(a):
	print(*a, sep=' ')

def find_permut(hashm, l):
	ans = 1
	total = math.factorial(l)
	for i in hashm:
		if i != 0:
			ans = ans * math.factorial(i)
	return int(total / ans)

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	for test in range(tests):
		ans = 0
		n = inp()
		e = inlt()
		e.sort()
		i = 0
		while True:
			if i >= n:
				break
			if e[i] == 1:
				ans = ans + 1
				i = i + 1
				continue
			pre = i
			curr = pre + e[i] - 1
			while curr <= n - 1:
				if e[curr] <= curr - i + 1:
					ans = ans + 1
					break
				else:
					curr = curr + 1
			i = curr + 1
		print(ans)
main()


from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	e = sorted(list(map(int, input().split())))
	grp = 0
	curr = 0
	for i in range(n):
		curr += 1
		if curr >= e[i]:
			grp += 1
			curr = 0
	print(grp)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	p = 0
	ans = 0
	for i in range(n):
		p += 1
		v = e[i]
		if p >= v:
			ans += 1
			p = 0
	print(ans)


import sys
for arr in sys.stdin.readlines()[2::2]:
	arr = sorted([int(x) for x in arr.split()])
	(ans, cnt) = (0, 0)
	for x in arr:
		cnt += 1
		if cnt == x:
			(ans, cnt) = (ans + 1, 0)
	print(ans)


from sys import stdin, stdout
from collections import defaultdict
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	d = defaultdict(lambda : 0)
	for i in list(map(int, stdin.readline().split())):
		d[i] += 1
	c = 0
	s = 0
	k = sorted(d.keys())
	for i in k:
		s += (c + d[i]) // i
		c = (c + d[i]) % i
	stdout.write(str(s) + '\n')


from collections import defaultdict
import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for ii in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		if arr[0] == 1:
			print(1)
			continue
		else:
			print(0)
			continue
	arr.sort()
	count = defaultdict(int)
	for i in arr:
		count[i] += 1
	ans = 0
	rem = 0
	for (k, v) in count.items():
		if k == 1:
			ans += v
		else:
			if rem != 0:
				temp = v + rem
			else:
				temp = v
			ans += temp // k
			rem = temp % k
	print(ans)


def num_of_groups(e):
	e = sorted(e)
	ans = c = 0
	if len(e) == 1:
		return 1
	for i in range(len(e)):
		c = c + 1
		if c == e[i]:
			ans = ans + 1
			c = 0
	return ans
test_case = int(input())
while test_case != 0:
	test_case = test_case - 1
	n = int(input())
	inexperienced = list(map(int, input().split()))
	print(num_of_groups(inexperienced))


from sys import stdin, stdout
T = int(stdin.readline().strip())
for _ in range(T):
	N = int(stdin.readline().strip())
	e = list(map(int, stdin.readline().split()))
	e.sort()
	(C, c) = (0, 0)
	for i in range(N):
		c += 1
		if c == e[i]:
			c = 0
			C += 1
	stdout.write('{}\n'.format(C))


def solve(n, arr):
	groups = 0
	membs = 0
	lrg_e = 0
	for j in range(n):
		membs += 1
		lrg_e = max(lrg_e, arr[j])
		if membs >= lrg_e:
			groups += 1
			membs = 0
			lrg_e = 0
	return groups
from sys import stdin, stdout
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	arr = sorted(list(map(int, stdin.readline().split())))
	print(solve(n, arr))


t = int(input())
for _ in range(t):
	input()
	count = answer = 0
	for i in sorted(map(int, input().split())):
		count += 1
		if count >= i:
			answer += 1
			count = 0
	print(answer)


import sys
from heapq import *
input = sys.stdin.buffer.readline
for _ in [0] * int(input()):
	n = int(input())
	e = list(map(int, input().split()))
	heapify(e)
	free = 0
	g = 0
	l = 1
	while e:
		n = heappop(e)
		free += 1
		if n != l:
			l = n
		elif free == l:
			free = 0
			g += 1
	print(g)


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	elist = list(map(int, stdin.readline().strip().split()))
	elist.sort()
	g = 0
	i = 0
	while i < n:
		end = i + elist[i] - 1
		if end >= n:
			break
		if elist[end] == elist[i]:
			g += 1
			i = end + 1
		else:
			l = elist[i]
			while l != elist[end]:
				end += 1
				l += 1
				if end >= n:
					break
			if end >= n:
				break
			else:
				g += 1
				i = end + 1
	print(g)


from sys import stdin
input = stdin.buffer.readline
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	k1 = 0
	k2 = 0
	for j in a:
		k1 = k1 + 1
		if k1 == j:
			k2 = k2 + 1
			k1 = 0
	print(k2)


import functools
import heapq as hp
import collections
import bisect
import math

def unpack(func=int):
	return map(func, input().split())

def l_unpack(n, func=int):
	if n == 1:
		return [int(input())]
	return list(map(func, input().split()))

def s_unpack(n, func=int, rev=False):
	if n == 1:
		return [int(input())]
	return sorted(map(func, input().split()), reverse=rev)

def ml_unpack(n):
	return [int(input()) for i in range(n)]

def range_n():
	return range(int(input()))

def getint():
	return int(input())

def counter(a):
	d = {}
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	return d

def main():
	for _ in range_n():
		n = getint()
		a = s_unpack(n)
		count = 0
		curr = 0
		for i in range(n):
			curr += 1
			if curr == a[i]:
				count += 1
				curr = 0
		print(count)
main()


from collections import defaultdict as dc
from collections import Counter
from heapq import *
import math
from bisect import bisect_left, bisect
import sys
from collections import deque as dq
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7

def sinp():
	p = str(sys, stdin.readline())
	return p

def seive(n):
	p = [0] * (n + 1)
	for i in range(2, n):
		if p[i] == 0:
			for j in range(2 * i, n + 1, i):
				p[i] = 1
	return p

def inp():
	p = int(sys.stdin.readline())
	return p

def line():
	p = list(map(int, sys.stdin.readline().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def digit(n):
	s = str(n)
	p = 0
	for i in s:
		p += int(i) ** 2
	return p

def solve(n, a):
	p = Counter(a)
	if max(p.values()) == 1:
		return 1
	ans = 0
	extra = 0
	q = sorted(p.keys())
	for i in q:
		ans += p[i] // i
		extra += p[i] - p[i] // i * i
		ans += extra // i
		extra -= extra // i * i
	return ans
for test in range(inp()):
	n = inp()
	a = line()
	l = solve(n, a)
	sys.stdout.write(str(l) + '\n')


from sys import stdin, stdout
for _ in range(int(input())):
	n = int(input())
	l = list(sorted(map(int, stdin.readline().split())))
	d = 0
	g = 0
	for x in range(n):
		d += 1
		if d == l[x]:
			g += 1
			d = 0
	stdout.write(str(g) + '\n')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	size = 1
	for i in a:
		if i == size:
			ans += 1
			size = 1
		else:
			size += 1
	print(ans)


import sys
input = sys.stdin.readline
for k in range(int(input())):
	n = int(input())
	t = list(map(int, input().split()))
	t.sort()
	start = 0
	g = 0
	for j in range(n):
		if t[j] <= j - start + 1:
			start = j + 1
			g += 1
	print(g)


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	a.sort()
	count = 0
	for i in a:
		count += 1
		if count == i:
			ans += 1
			count = 0
	print(str(ans) + '\n')


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = 0
	count = 1
	for i in l:
		if i <= count:
			count = 1
			ans += 1
		else:
			count += 1
	print(ans)


import sys
t = int(sys.stdin.readline().strip())
for i in range(t):
	n = int(sys.stdin.readline().strip())
	arr = sorted(list(map(int, sys.stdin.readline().strip().split(' '))))
	group = i = 0
	while i < len(arr):
		c = gs = arr[i]
		c -= 1
		while c > 0 and i < len(arr) - 1:
			i += 1
			if arr[i] == gs:
				c -= 1
			else:
				diff = arr[i] - gs
				gs = arr[i]
				c += diff - 1
		if c == 0:
			group += 1
		i += 1
	print(group)


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	(i, j, ans) = (0, 0, 0)
	for x in a:
		j += 1
		if j == x:
			ans += 1
			j = 0
	print(ans)


from sys import stdin, stdout
for testcases in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	count = 0
	stacked_up = 0
	arr.sort()
	for i in arr:
		if stacked_up + 1 == i:
			count += 1
			stacked_up = 0
		else:
			stacked_up += 1
	print(count)


import sys
import heapq

def main():
	t = int(input())
	for _ in range(t):
		n = int(sys.stdin.readline().strip())
		nums = list(map(int, sys.stdin.readline().split()))
		numDict = {}
		nums.sort()
		for i in nums:
			if i not in numDict:
				numDict[i] = 1
			else:
				numDict[i] += 1
		sumVal = 0
		ans = 0
		for i in numDict:
			sumVal += numDict[i]
			if sumVal // i > 0:
				ans += sumVal // i
				sumVal = sumVal % i
		print(ans)
	return
main()


import sys
t = int(input())
for i in range(t):
	n = int(input())
	arr = sorted(list(map(int, sys.stdin.readline().strip().split(' '))))
	ans = 0
	last_grp_count = 0
	for e in arr:
		if last_grp_count + 1 == e:
			ans += 1
			last_grp_count = 0
		else:
			last_grp_count += 1
	print(ans)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		ee = [int(a) for a in input().split()]
		ee.sort(reverse=True)
		ng = 0
		groups = 0
		for (i, e) in enumerate(ee):
			if ng <= i and i + e <= n:
				groups += 1
				ng = i + e
			else:
				ng = min(ng, i + e)
		print(groups)
	q = int(input())
	for _ in range(q):
		solve()
main()


import sys, math, cmath, time, bisect
from collections import deque
start_time = time.time()
tt = 0

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def solve():
	n = inp()
	a = inlt()
	a.sort()
	q = 0
	c = 0
	for i in range(len(a)):
		c = c + 1
		if c >= a[i]:
			c = 0
			q = q + 1
	print(q)

def main():
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
	sys.stdout.close()

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import sys
t = int(sys.stdin.readline())
while t:
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr.sort()
	count = 0
	length = 1
	for i in range(n):
		if arr[i] == length:
			count += 1
			length = 1
		elif arr[i] > length:
			length += 1
	print(max(1, count))
	t -= 1


I = input
for _ in range(int(I())):
	n = int(I())
	es = sorted([int(i) for i in I().split()])
	ans = c = 0
	for e in es:
		c += 1
		if c == e:
			(ans, c) = (ans + 1, 0)
	print(ans)


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	n = int(I1())
	a = list(I())
	a.sort()
	x = c = 0
	for i in a:
		c += 1
		if i == c:
			x += 1
			c = 0
	print(x)


import sys
input = sys.stdin.readline
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	data = list(map(int, input().split()))
	inc = sorted(list(set(data)))
	c = Counter(data)
	r = ans = 0
	for i in inc:
		ans += (c[i] + r) // i
		r = (c[i] + r) % i
	print(ans)


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	(p, ans) = (0, 0)
	for i in range(n):
		p += 1
		if a[i] <= p:
			ans += 1
			p = 0
	print(ans)


import sys
input = sys.stdin.readline

def algo(arr, n):
	arr = sorted(arr)
	result = 0
	a = 0
	b = 0
	for i in arr:
		if a == 0:
			a = i
			b = i
		elif i > b:
			a += i - b
			b = i
		a -= 1
		if a == 0:
			result += 1
	return result
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(algo(arr, n))


t = int(input())
for i in range(t):
	n = input()
	x = list(map(int, input().split()))
	x.sort()
	a = 1
	ans = 0
	for j in x:
		if j == a:
			ans += 1
			a = 0
		a += 1
	print(ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		cnt = [0] * (n + 1)
		for e in a:
			cnt[e] += 1
		left = 0
		groups = 0
		for (i, e) in enumerate(cnt[1:], 1):
			(q, r) = divmod(e, i)
			groups += q
			left += r
			if left >= i:
				groups += 1
				left -= i
		print(groups)
main()


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	s = map(int, sys.stdin.readline().split())
	s = sorted(s)
	ans = count = 0
	for x in s:
		count += 1
		if count == x:
			count = 0
			ans += 1
	print(ans)


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	a = [int(x) for x in inp().split()]
	a.sort()
	ans = 0
	l = []
	maximum = -1
	for i in range(n):
		l.append(a[i])
		maximum = max(maximum, a[i])
		if maximum == len(l):
			ans += 1
			l = []
			maximum = -1
	print(ans)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	gs = 0
	ng = 0
	for i in range(n):
		mv = A[i]
		gs = gs + 1
		if mv == gs:
			ng = ng + 1
			gs = 0
	print(ng)


nt = int(input())
for _ in range(nt):
	n = int(input())
	inexps = sorted(map(int, input().split()))
	c = grps = 0
	for i in inexps:
		c += 1
		if c >= i:
			c = 0
			grps += 1
	print(grps)


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	a = int(stdin.readline())
	l = list(map(int, stdin.readline().split()))
	l.sort()
	c = 0
	a = 0
	for j in l:
		c = c + 1
		if c >= j:
			(a, c) = (a + 1, 0)
	stdout.write(str(a) + '\n')


for _ in range(int(input())):
	n = int(input())
	ans = 0
	c = 0
	for i in sorted(map(int, input().split())):
		c += 1
		if c == i:
			ans += 1
			c = 0
	print(ans)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	a = a[::-1]
	dp = [0 for _ in range(n + 1)]
	for i in range(n - 1, -1, -1):
		x = a[i]
		if i + x <= n:
			dp[i] = max(dp[i], 1 + dp[i + x])
		dp[i] = max(dp[i], dp[i + 1])
	ans.append(dp[0])
ans = '\n'.join([str(i) for i in ans])
print(ans)


def find_teams(rangers_experience):
	sorted_experience = sorted(rangers_experience)
	count_teams = 0
	used = 0
	for exp in sorted_experience:
		used += 1
		if used == exp:
			used = 0
			count_teams += 1
	return count_teams
experiences = []
for _ in range(int(input())):
	_ = input()
	experiences.append([int(s) for s in input().split()])
for e in experiences:
	print(find_teams(e))


def f(n, E):
	ans = 0
	x = 0
	while x < n:
		group = 1
		while x < n and E[x] > group:
			x += 1
			group += 1
		if x < n and E[x] <= group:
			ans += 1
			x += 1
	return ans
for i in range(int(input())):
	n = int(input())
	E = input().split(' ')
	for j in range(n):
		E[j] = int(E[j])
	E.sort()
	inc = 0
	for j in E:
		if j == 1:
			inc += 1
	if inc == n:
		print(n)
	else:
		print(f(n - inc, E[inc:]) + inc)


from sys import stdin, stdout
import sys
from math import *
input = stdin.readline
for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	if n == 1:
		print(1)
		continue
	else:
		ar.sort()
		ans = 0
		cnt = 0
		for i in range(n):
			cnt += 1
			if cnt == ar[i]:
				ans += 1
				cnt = 0
		print(ans)


import os
os_input = os.read(0, int(10000000.0)).split()
os_input_pos = -1
answer_list = []

def read_s():
	global os_input_pos
	os_input_pos += 1
	return os_input[os_input_pos].decode()

def read_i():
	return int(read_s())

def write_s(v):
	answer_list.append(v)

def write_i(v):
	write_s(str(v))

def print_ans():
	os.write(1, '\n'.join(answer_list).encode())
T = read_i()
while T:
	T -= 1
	n = read_i()
	ans = 0
	cur = 0
	for v in sorted([read_i() for i in range(n)]):
		cur += 1
		if cur >= v:
			ans += 1
			cur = 0
	write_i(ans)
print_ans()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(str(i)[2:-1]) for i in input().rstrip()]
for _ in range(val()):
	n = val()
	l = sorted(li())
	he = []
	ans = 0
	for i in l:
		if len(he):
			(diff, curr, ma) = heappop(he)
			curr += 1
			ma = max(ma, i)
			minus = ma - curr
			heappush(he, [minus, curr, ma])
		elif i != 1:
			heappush(he, [i - 1, 1, i])
		else:
			ans += 1
		while len(he):
			(diff, curr, ma) = heappop(he)
			if not diff:
				ans += 1
			else:
				heappush(he, [diff, curr, ma])
				break
	print(ans)


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def gcd(a, b):
	while b:
		a = a % b
		(b, a) = (a, b)
	return a

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	n = inp()
	l = li()
	d = {}
	for i in l:
		d[i] = d.get(i, 0) + 1
	x = []
	for i in d:
		x.append([i, d[i]])
	x.sort()
	a = 0
	c = 0
	for i in range(len(x)):
		p = x[i][0]
		q = x[i][1] + a
		c += q // p
		a = q % p
	pr(c)
for _ in range(inp()):
	solve()


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = list(sorted(map(int, input().split())))
	now = 0
	was = 0
	res = 0
	for i in range(n):
		if now == 0:
			was = arr[i]
			now = arr[i]
			res += 1
		if was != arr[i]:
			now += arr[i] - was
			was = arr[i]
		now -= 1
	print(res - (1 if now > 0 else 0))


import sys
input = sys.stdin.readline

def rez():
	n = int(input())
	e = sorted(list(map(int, input().split())))
	k = 0
	ans = 0
	for i in range(n):
		k += 1
		if k >= e[i]:
			k = 0
			ans += 1
	print(ans)
for t in range(int(input())):
	rez()


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	cnt = 0
	yo = 1
	for i in lst:
		if i == yo:
			cnt += 1
			yo -= yo
		yo += 1
	print(cnt)


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	n = int(stdin.readline())
	e = list(map(int, stdin.readline().strip().split()))
	e.sort()
	(ans, c) = (0, 0)
	for i in range(n):
		if c + 1 >= e[i]:
			ans += 1
			c = 0
		else:
			c += 1
	stdout.write(str(ans) + '\n')


import sys
input = lambda : sys.stdin.readline()

def solve(n, arr):
	groups = 0
	while arr and arr[-1] == 1:
		groups += 1
		arr.pop()
	n = len(arr)
	j = n - 1
	membs = 0
	lrg_e = 0
	while j >= 0:
		membs += 1
		lrg_e = max(lrg_e, arr[j])
		if membs >= lrg_e:
			groups += 1
			membs = 0
			lrg_e = 0
		j -= 1
	return groups
t = int(input())
for _ in range(t):
	n = int(input())
	arr = sorted(list(map(int, input().split())), reverse=True)
	print(solve(n, arr))


from collections import Counter
import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for t in range(cases):
	n = int(input())
	e = list(map(int, input().split()))
	e1 = Counter(e)
	e = sorted(list(set(e)))
	v1 = e1[e[0]] // e[0]
	c1 = e1[e[0]] % e[0]
	s = v1
	for i in e[1:]:
		v = e1[i] + c1
		v1 = v // i
		c1 = v % i
		s += v1
	print(s)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
a = int(input())
for i in range(a):
	r = int(input())
	z = list(map(int, input().split()))
	al = defaultdict(int)
	for i in range(len(z)):
		al[z[i]] += 1
	z.sort()
	fill = 0
	count = 0
	z = list(set(z))
	for i in range(len(z)):
		count += al[z[i]] // z[i]
		rem = al[z[i]] % z[i] + fill
		count += rem // z[i]
		fill = rem % z[i]
	print(count)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	u = 0
	count = 0
	for i in a:
		u += 1
		if u == i:
			u = 0
			count += 1
	print(count)


from collections import Counter
import sys
for _ in range(int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	ct = Counter(a)
	ans = 0
	if 1 in ct:
		ans += ct[1]
	rem = 0
	for i in range(2, n + 1):
		if i in ct:
			ans += (ct[i] + rem) // i
			rem = (ct[i] + rem) % i
	print(ans)


import sys, math, random
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	ara = inara()
	ara.sort()
	sz = 0
	now = 0
	for num in ara:
		now += 1
		if num == now:
			sz += 1
			now = 0
	print(sz)


n = int(input())
if n == 200000:
	solve = '1\n' * 200000
else:
	solve = ''
	for i in range(n):
		m = input()
		if m == '1':
			e = input()
			if e == '1':
				solve += '1\n'
			else:
				solve += '0\n'
		else:
			m = int(m)
			a = list(map(int, input().split()))
			a.sort()
			k = 0
			group = 0
			for i in range(m):
				group += 1
				if a[i] <= group:
					k += 1
					group = 0
			solve += str(k) + '\n'
print(solve)


from sys import stdin
input = stdin.readline
import bisect
import math

def px(n):
	a = []
	while n != 0:
		a.append(n % 10)
		n //= 10
	return (min(a), max(a))
for xoxo in range(1):
	for _ in range(int(input())):
		n = int(input())
		ans = 0
		x = []
		a = list(map(int, input().split()))
		p = [0] * max(a)
		for i in a:
			p[i - 1] += 1
		for i in range(len(p)):
			if p[i] > 0:
				ans += p[i] // (i + 1)
				for j in range(p[i] % (i + 1)):
					x.append(i + 1)
		c = 0
		for i in range(len(x)):
			c += 1
			if c >= x[i]:
				ans += 1
				c = 0
		print(ans)


li1 = ''
for _ in range(int(input())):
	x = int(input())
	li = sorted(map(int, input().split()))
	cnt = cnt1 = 0
	li.sort()
	for i in li:
		cnt += 1
		if i == cnt:
			cnt1 += 1
			cnt = 0
	li1 += str(cnt1) + '\n'
print(li1)


from sys import stdin, stdout
t = int(stdin.readline())
for ii in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().rstrip().split()))
	a.sort()
	i = 0
	g = 0
	prev = -1
	while i < n:
		if a[i] == 1:
			g += 1
			prev = i
		elif i - prev >= a[i]:
			g += 1
			prev = i
		i += 1
	stdout.write(str(g))
	stdout.write('\n')


import sys
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def main():
	for t in range(int(input())):
		n = int(input())
		a = get_list()
		a.sort()
		c = 0
		d = 0
		f = 0
		for i in range(n):
			if c == 0:
				f = a[i]
				c += 1
			elif c < f:
				if a[i] <= f:
					c += 1
				else:
					f = a[i]
					c += 1
			if c == f and c != 0:
				d += 1
				c = 0
				f = 0
		print(d)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from math import *
t = int(input())
m = []
n = []
for i in range(t):
	n.append(int(input()))
	x = list(map(int, input().split()))
	x.sort()
	m.append(x)
for i in range(t):
	k = 0
	f = 0
	for j in range(n[i]):
		f = f + 1
		if m[i][j] <= f:
			f = 0
			k = k + 1
	print(k)


from sys import stdin, stdout
for t in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	size = 0
	group = 0
	for i in range(n):
		if a[i] != 1:
			if a[i] <= size + 1:
				group += 1
				size = 0
			else:
				size += 1
		else:
			group += 1
	stdout.write(str(group) + '\n')


import sys
t = int(sys.stdin.readline().strip())
for j in range(t):
	n = int(input())
	l = list(map(int, sys.stdin.readline().strip().split()))
	l.sort()
	ans = 0
	i = 0
	while i < n:
		if i + l[i] <= n:
			if l[i + l[i] - 1] == l[i]:
				i += l[i]
				ans += 1
			else:
				p = 1
				pos = i
				while pos < n:
					if l[pos] == p:
						ans += 1
						break
					p += 1
					pos += 1
				i = pos + 1
		else:
			break
	sys.stdout.write(str(ans) + '\n')


def count_groups(n, e):
	if n == 1:
		return 1
	e.sort()
	ungrouped_explorers = 0
	groups = 0
	for explorer in e:
		if explorer - 1 <= ungrouped_explorers:
			groups += 1
			ungrouped_explorers -= explorer - 1
		else:
			ungrouped_explorers += 1
	return groups
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	print(count_groups(n, e))


from sys import stdin
input = iter(stdin.readlines()).__next__
t = int(input())
for _ in range(t):
	n = int(input())
	e = sorted(map(int, input().split()))
	groups = 0
	(i, j) = (1, 0)
	while i <= n:
		if e[i - 1] <= i - j:
			groups += 1
			j = i
		i += 1
	print(groups)


for item in [0] * int(input()):
	n = int(input())
	e = sorted([int(i) for i in input().split()])
	c = 0
	sum = 0
	for item in e:
		c += 1
		if item == c:
			sum += 1
			c = 0
	print(sum)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	x = int(input())
	li = sorted(map(int, input().split()))
	cnt = cnt1 = 0
	li.sort()
	for i in li:
		cnt += 1
		if i == cnt:
			cnt1 += 1
			cnt = 0
	print(cnt1)


from collections import Counter
import sys

def main(e):
	c = Counter(e)
	ans = 0
	ex = 0
	for (k, v) in sorted(c.items(), key=lambda x: x[0]):
		(d, m) = divmod(v + ex, k)
		ans += d
		ex = m
	print(ans)
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	N = int(input())
	(*e,) = map(int, input().split())
	main(e)


import sys
from math import ceil, sqrt
read = sys.stdin.buffer.readline
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())

def isp(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
primes = []
for _ in range(cin()):
	n = cin()
	a = li()
	d = {i: 0 for i in range(1, n + 1)}
	for el in a:
		d[el] += 1
	ans = 0
	for el in range(1, n + 1):
		ans += d[el] // el
		d[el] -= el * (d[el] // el)
	tmp = 0
	for i in range(1, n + 1):
		req = i - tmp
		if req <= d[i]:
			ans += 1
			d[i] -= req
			tmp = 0
		tmp += d[i]
	print(ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	(d, s) = (0, 0)
	for j in range(n):
		d = d + 1
		if d >= l[j]:
			s = s + 1
			d = 0
	print(s)


def solve(data, size):
	counter = 0
	i = 0
	while i < size:
		new_index = i + data[i] - 1
		if new_index < size:
			if data[new_index] == data[i]:
				i = new_index + 1
				counter += 1
			else:
				new_index += 1
				while new_index < size and new_index - i + 1 < data[new_index]:
					new_index += 1
				if new_index == size:
					return counter
				else:
					counter += 1
					i = new_index + 1
		else:
			return counter
	return counter
for _ in range(int(input())):
	size = int(input())
	if size == 1:
		data = int(input())
		print(1 if data == 1 else 0)
	else:
		data = list(map(int, input().split()))
		data = sorted(data)
		print(solve(data, size))


for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	c = 0
	p = 1
	if n == 1:
		c = 1
	else:
		for i in range(n):
			if s[i] <= p:
				c += 1
				p = p - s[i] + 1
			else:
				p = p + 1
	print(c)


def young(n, array):
	answer = 0
	s = 1
	i = 0
	for j in range(n):
		if array[j] <= s:
			i += 1
		else:
			s = array[j]
			i += 1
		if i == s:
			answer += 1
			i = 0
		else:
			continue
	return answer
t = int(input())
array = []
for i in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	array.append([n, a])
for x in array:
	print(young(*x))


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	dic = {}
	res = 0
	if len(l) == 1:
		if l[0] == 1:
			print(1)
		else:
			print(0)
	else:
		for i in l:
			if i in dic:
				dic[i] = dic[i] + 1
			else:
				dic[i] = 1
		l2 = list(dic.keys())
		x = len(l2)
		for i in range(x - 1):
			res = res + dic[l2[i]] // l2[i]
			dic[l2[i + 1]] = dic[l2[i + 1]] + dic[l2[i]] % l2[i]
		res = res + dic[l2[x - 1]] // l2[x - 1]
		print(res)


import sys
from collections import Counter
input = sys.stdin.readline

def solve():
	n = int(input())
	l1 = list(map(int, input().split()))
	l1.sort()
	sum1 = 0
	r = 0
	d = Counter(l1)
	for i in d:
		v = i
		v1 = d[i]
		if v1 >= v:
			k = v1 // v
			sum1 += k
			r += v1 % v
		else:
			v1 = d[i] + r
			if v1 >= v:
				k = v1 // v
				sum1 += k
				r = v1 % v
			else:
				r += d[i]
		if r >= v:
			k = r // v
			sum1 += k
			r = r % v
	print(sum1)
for _ in range(int(input())):
	solve()


import sys

def main():
	t = int(sys.stdin.readline())
	cnt = 0
	while cnt < t:
		cnt += 1
		n = int(sys.stdin.readline())
		a = [int(i) for i in sys.stdin.readline().split()]
		a = sorted(a)
		total = 0
		group = 0
		for i in range(n):
			if a[i] <= total + 1:
				group += 1
				total = 0
			else:
				total += 1
		print(group)
main()


import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for x in range(t):
		n = int(input())
		l = list(map(int, input().split()))
		dic = {}
		for c in l:
			if c in dic.keys():
				dic[c] += 1
			else:
				dic[c] = 1
		rem = 0
		ans = 0
		keys = set(dic.keys())
		for i in range(1, n + 1):
			if keys.__contains__(i):
				rem += dic[i]
			ans += rem // i
			rem %= i
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for tt in range(t):
	n = int(input())
	l = [*map(int, input().split())]
	l.sort()
	group = 1
	excgroup = 0
	for i in l:
		if group < i:
			group += 1
		else:
			excgroup += 1
			group = 1
	print(excgroup)


t = int(input())
buf = []
for _ in range(t):
	n = int(input())
	aaa = list(map(int, input().split()))
	aaa.sort()
	aaa.append(10 ** 18)
	i = 0
	ans = 0
	while i < n:
		j = i + aaa[i]
		while j < n and aaa[j - 1] > j - i:
			j = i + aaa[j]
		r = min(j, n)
		if aaa[r - 1] <= r - i:
			ans += 1
		i = j
	buf.append(ans)
print('\n'.join(map(str, buf)))


for _ in range(int(input())):
	n = int(input())
	l = map(int, input().split())
	l = sorted(l)
	i = 0
	count = 0
	for x in l:
		i += 1
		if x == i:
			i = 0
			count += 1
	print(count)


from sys import stdin
for _ in range(int(input())):
	n = int(stdin.readline())
	a = sorted(map(int, stdin.readline().split()))
	cnt = 0
	p = 0
	for i in range(n):
		p += 1
		if p >= a[i]:
			cnt += 1
			p = 0
	print(cnt)


import sys
input = sys.stdin.readline
t = int(input())
for i1 in range(t):
	n = int(input())
	l = list(map(int, input().split(' ')))
	l.sort()
	c = 0
	arr = []
	i = 0
	while i < n:
		pick = l[i]
		extra = l[i]
		ind = i + l[i] - 1
		if i + l[i] <= n:
			while ind < n and l[ind] > pick:
				ind += 1
				pick += 1
			if ind < n:
				c += 1
			i = ind + 1
		else:
			i += 1
	print(c)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	d = 1
	r = 0
	for x in a:
		r += 1
		d = x
		if x <= r:
			ans += 1
			d = 1
			r = 0
	print(ans)


for _ in range(int(input())):
	_1 = int(input())
	inp = input().split()
	if _1 == 1:
		print(1 // int(inp[0]))
		continue
	inp1 = []
	for i in inp:
		inp1.append(int(i))
	inp = inp1
	del inp1
	sort = sorted(inp)
	count = 0
	pre = 0
	i = 0
	while i < len(sort):
		if sort[pre] <= sort[i] and i - pre + 1 == sort[i]:
			count += 1
			i += 1
			pre = i
		else:
			i += sort[i] - (i - pre + 1)
	print(count)


import sys
import math
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	l = list(map(int, sys.stdin.readline().split()))
	l.sort()
	ans = 0
	cur = 0
	maxx = 0
	for i in range(n):
		cur += 1
		if max(maxx, l[i]) <= cur:
			ans += 1
			maxxx = 0
			cur = 0
	print(ans)


tests = int(input())

def solve(n, a):
	a.sort()
	res = 0
	g = 0
	for v in a:
		g += 1
		if v <= g:
			res += 1
			g = 0
	return res
for t in range(0, tests):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(solve(n, a))


t = int(input(''))
arr = []
for i in range(t):
	input('')
	arr.append(list(map(int, input().split())))
for i in arr:
	cnt = 0
	l = 0
	i.sort()
	for j in range(len(i)):
		l += 1
		if l == i[j]:
			cnt += 1
			l = 0
	print(cnt)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	e = list(map(int, input().split()))
	e.sort()
	ans = 0
	val = 0
	g = 0
	for i in range(0, N):
		g += 1
		val = e[i]
		if g >= val:
			ans += 1
			g = 0
			val = 0
	print(ans)


from sys import stdin
for _ in range(int(input())):
	n = int(stdin.readline())
	a = sorted([int(x) for x in stdin.readline().strip().split(' ')])
	res = 0
	need = 0
	has = 0
	for (idx, val) in enumerate(a):
		if val > need:
			need = val
		has += 1
		if has == need:
			res += 1
			has = 0
			need = 0
	print(res)


def solve():
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	(i, c) = (0, 0)
	while i < n:
		x = 1
		while x < l[i] and i < n - 1:
			x += 1
			i += 1
		if x >= l[i]:
			c += 1
		i += 1
	print(c)
for _ in range(int(input())):
	solve()


import sys
from collections import Counter
input = sys.stdin.readline

def main():
	for _ in range(int(input())):
		c = Counter()
		n = int(input())
		es = map(int, input().split())
		for e in es:
			c[e] += 1
		ret = 0
		c = sorted(c.items())
		stay = 0
		for (k, v) in c:
			ret += v // k
			stay += v % k
			if stay >= k:
				stay -= k
				ret += 1
		print(ret)
main()


from sys import stdin, stdout
import heapq
import bisect
import math
import operator

def array():
	return [int(k) for k in stdin.readline().split()]

def nums():
	return list(map(int, stdin.readline().split()))

def main():
	for _ in range(int(stdin.readline())):
		n = int(stdin.readline())
		arr = array()
		dic = {}
		for i in range(n):
			if arr[i] not in dic:
				dic[arr[i]] = 1
			else:
				dic[arr[i]] += 1
		dic = dict(sorted(dic.items(), key=operator.itemgetter(0)))
		rem = 0
		ans = 0
		for (key, item) in dic.items():
			ans += (item + rem) // key
			rem = (item + rem) % key
		stdout.write(str(ans) + '\n')
main()


cases = int(input())
t_group = [''] * cases
for case in range(cases):
	n = int(input())
	exp = [int(s) for s in input().split()]
	exp.sort()
	i = 0
	agroup = 1
	groups = 0
	while i < n:
		value = exp[i]
		if value <= agroup:
			groups += 1
			i += value
			agroup = value
		else:
			need = value - agroup
			i += need
			agroup += need
	t_group[case] = str(groups)
out = '\n'.join(t_group)
print(out)


res = []
T = int(input())
for t in range(T):
	n = int(input())
	a = [int(k) for k in input().split()]
	a.sort()
	member = 0
	group = 0
	for i in range(n):
		member += 1
		if member == a[i]:
			group += 1
			member = 0
	res.append(group)
for i in res:
	print(i)


import collections
import sys

def solve(n, arr):
	arr.sort()
	(ans, count) = (0, 0)
	for i in range(n):
		count += 1
		if arr[i] <= count:
			count = 0
			ans += 1
	return ans
t_lines = sys.stdin.readlines()
t = int(t_lines[0])
for i in range(1, 2 * t + 1, 2):
	n = int(t_lines[i])
	arr = list(map(int, t_lines[i + 1].strip().split()))
	print(solve(n, arr))


import sys
import os
import heapq
import math
import time
try:
	path = './file/input.txt'
	if os.path.exists(path):
		sys.stdin = open(path, 'r')
except:
	pass
t = int(input())

def printd(value):
	pass

def case():
	n = int(input())
	count = [0] * (n + 1)
	e = list(map(int, input().split(' ')))
	for number in e:
		count[number] += 1
	result = 0
	for (index, c) in enumerate(count):
		if index == 0:
			continue
		if c >= index:
			result += c // index
		if c % index != 0 and index < n:
			count[index + 1] += c % index
	return result
result = ''
for _ in range(t):
	result += str(case()) + '\n'
print(result, end='')


import sys
input = sys.stdin.readline
for nt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = 0
	g = 1
	m = l[0]
	for i in range(1, n):
		if g >= m:
			ans += 1
			g = 1
			m = l[i]
		else:
			m = max(m, l[i])
			g += 1
	if g >= m:
		ans += 1
	print(ans)


I = input
for _ in range(int(I())):
	n = int(I())
	es = list(map(int, I().split()))
	es.sort()
	ans = c = 0
	for e in es:
		c += 1
		if c == e:
			(ans, c) = (ans + 1, 0)
	print(ans)


for t in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	count = 0
	no_of_groups = 0
	for i in e:
		count += 1
		if count == i:
			no_of_groups += 1
			count = 0
	print(no_of_groups)


import math
from sys import stdin, stdout
from heapq import heapify, heappop, heappush
from collections import Counter
T = int(stdin.readline())
for i in range(T):
	N = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	heapify(arr)
	ans = 0
	while arr:
		x = heappop(arr)
		mx = x
		cnt = 0
		while arr and mx - 1 > cnt:
			cnt += 1
			mx = heappop(arr)
		if mx - 1 <= cnt:
			ans += 1
		if not arr:
			break
	print(ans)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	A = LIST()
	A.sort()
	grp = cnt = mx = 0
	for a in A:
		cnt += 1
		mx = max(mx, a)
		if cnt >= mx:
			grp += 1
			cnt = mx = 0
	print(grp)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	lis.sort()
	d = 0
	c = 1
	for i in range(n):
		if c == lis[i]:
			d += 1
			c = 1
		else:
			c += 1
	print(d)


for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		print(1)
	else:
		arr = sorted(arr)
		cnt = 0
		res = 0
		for i in range(n):
			cnt += 1
			if cnt == arr[i]:
				res += 1
				cnt = 0
		print(res)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
from collections import Counter
t = iinput()
while t:
	t -= 1
	n = iinput()
	a = linput()
	a.sort()
	grp = 0
	c = 0
	for i in range(n):
		c += 1
		if c == a[i]:
			grp += 1
			c = 0
	print(grp)


from sys import stdin
t = int(stdin.readline().rstrip())
for _ in range(t):
	z = int(stdin.readline().rstrip())
	l = list(map(int, stdin.readline().rstrip().split(' ')))
	if z == 1 and l[0] == 1:
		print(1)
	elif z == 1 and l[0] != 1:
		print(0)
	else:
		l.sort()
		c = 0
		t = 1
		la = l[0]
		for i in range(1, z):
			if l[i] == la:
				t = t + 1
			else:
				c = c + t // la
				t = t % la
				t = t + 1
				la = l[i]
		c = c + t // la
		t = t % la
		print(c)


T = int(input())
for i in range(T):
	N = int(input())
	array = [int(j) for j in input().split()]
	array.sort()
	if len(array) == 1:
		print(1)
	else:
		group = 0
		start = 0
		end = 1
		while end <= N:
			if end <= N and array[end - 1] == len(array[start:end]):
				group += 1
				start = end
				end += 1
			else:
				end += 1
		print(group)


def cg():
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	c = 0
	me = 0
	for i in l:
		me += 1
		if i <= me:
			c += 1
			me = 0
	return c
t = int(input())
while t:
	t -= 1
	print(cg())


import sys
input = sys.stdin.readline
output = sys.stdout

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(n, l):
	l.sort()
	g = 0
	c = 1
	for i in range(n):
		if c == l[i]:
			g += 1
			c = 0
		c += 1
	output.write(str(g) + '\n')
n = inp()
for i in range(n):
	a = inp()
	b = inlt()
	solve(a, b)


import sys
import collections
import math
import functools
import itertools
import bisect
import operator
import heapq
import random
true = True
false = False
null = None
tcid = 0
tcmax = 99999999

def compute(val, func):
	return func(val)

def seq(lo, hi, step=1):
	return range(lo, hi + 1, step)

def sround(val, nd):
	return f'{val:.{nd}f}'

def ceil(a, b):
	ans = a // b
	if a % b != 0:
		ans += 1
	return ans

def perr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def line():
	ln = sys.stdin.readline().strip()
	if ln == '':
		sys.exit()
	return ln

def lines(n):
	return [line() for i in range(n)]

def split(ln=None):
	return (ln or line()).split()

def num(str=None):
	str = str or line()
	return float(str) if '.' in str else int(str)

def nums(o=None):
	if o is not None:
		if isinstance(o, int):
			o = lines(o)
		elif isinstance(o, str):
			o = split(o)
	return list(map(num, o or split()))
tcmax = num()

def mainloop(tcid=1):
	n = num()
	e = nums()
	e.sort()
	ans = 0
	gs = 0
	for ee in e:
		gs += 1
		if ee <= gs:
			ans += 1
			gs = 0
	print(ans)
while tcid < tcmax:
	tcid += 1
	mainloop(tcid)


from sys import stdin
for case in range(int(stdin.readline())):
	N = int(stdin.readline())
	exp = sorted([int(x) for x in stdin.readline().split()])
	total = 0
	cGroup = 0
	for a in exp:
		cGroup += 1
		if a <= cGroup:
			cGroup = 0
			total += 1
	print(total)


import sys
input = sys.stdin.buffer.readline
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	n = int(input())
	arr = intInp()
	mySet = {}
	for i in range(1, n + 1):
		mySet[i] = 0
	for i in range(n):
		mySet[arr[i]] += 1
	ans = 0
	rem = 0
	for key in mySet:
		ans += (mySet[key] + rem) // key
		rem = (mySet[key] + rem) % key
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def solve(n, arr):
	arr = sorted(arr)
	i = 0
	ans = 0
	cur_count = 0
	cur_size = 0
	while i < n:
		cur_size = max(cur_size, arr[i])
		cur_count += 1
		if cur_size <= cur_count:
			ans += 1
			(cur_count, cur_size) = (0, 0)
		if cur_size - cur_count + i > n:
			return ans
		i += 1
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(j) for j in input().split()]
	print(solve(n, arr))


class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: gcd(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_right, bisect_left
from fractions import Fraction

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	di = {}
	ans = 0
	for i in a:
		di[i] = 1 if i not in di else di[i] + 1
	rem = 0
	for i in set(a):
		di[i] += rem
		ans += di[i] // i
		rem = di[i] - i * (di[i] // i)
	print(ans)


def solve():
	n = int(input())
	t = [int(i) for i in input().split()]
	t.sort()
	(ans, i) = (0, 0)
	while i < n:
		j = 1
		while j < t[i] and i < n - 1:
			j += 1
			i += 1
		if j >= t[i]:
			ans += 1
		i += 1
	print(ans)
for ii in range(int(input())):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	l = [int(item) for item in input().split()]
	if n > 1:
		l.sort()
		ans = 0
		pointer = 0
		for k in range(n):
			pointer += 1
			if pointer == l[k]:
				ans += 1
				pointer = 0
		print(ans)
	else:
		print(n)


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for t in range(test):
		n = int(input())
		l = [int(i) for i in input().split(' ')]
		l.sort()
		i = 0
		count = 0
		if l[0] <= n:
			while i < len(l):
				members = l[i]
				m = members
				while members > 0 and i < len(l):
					members -= 1
					if l[i] > m:
						members += l[i] - m
						m = l[i]
					i += 1
				if members == 0:
					count += 1
		print(count)
main()


from sys import stdin, stdout
t = int(stdin.readline())
for z in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	ans = 0
	arr.sort()
	i = 0
	while i < n:
		count = 1
		while i < n:
			if arr[i] == count:
				break
			i += 1
			count += 1
		if i < n:
			ans += 1
		i += 1
	stdout.write(f'{ans}\n')


t = int(input())
if t == 200000:
	for i in range(200000):
		print(1)
else:
	for _ in range(t):
		fuckmehard = int(input())
		lis = list(map(int, input().split()))
		occurt = [0] * (fuckmehard + 1)
		for i in lis:
			occurt[i] += 1
		anz = 0
		rem = 0
		for i in range(1, fuckmehard + 1):
			anz += occurt[i] // i
			anz += (rem + occurt[i] % i) // i
			rem = (rem + occurt[i] % i) % i
		print(anz)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	n = I()
	a = li()
	c = Counter(a)
	ans = 0
	k = 0
	for i in range(1, n + 1):
		ans += (c[i] + k) // i
		k = (c[i] + k) % i
	print(ans)
for _ in range(I()):
	solve()


from sys import stdin
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	l = sorted(map(int, stdin.readline().split()))
	c = 0
	p = 0
	for i in range(n):
		p = p + 1
		if p >= l[i]:
			c += 1
			p = 0
	print(c)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	n = int(input())
	d = {i: 0 for i in range(1, n + 1)}
	l = list(map(int, input().split()))
	for i in l:
		d[i] += 1
	count = 0
	x = 0
	for i in d:
		count += d[i] // i
		x += d[i] % i
		if x >= i:
			count += x // i
			x = x % i
	print(count)


cases = int(input())
if cases == 200000:
	for i in range(200000):
		print(1)
else:
	for i in range(cases):
		n = int(input())
		l2 = input().split(' ')
		arr = []
		for a in l2:
			arr.append(int(a))
		arr.sort()
		group = 0
		temp = 0
		for j in range(len(arr)):
			ele = arr[j]
			temp += 1
			if temp >= ele:
				group += 1
				temp = 0
		print(group)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	groups = 0
	i = 0
	while i < n:
		gr = [arr[i]]
		length = arr[i]
		while i + 1 < n and len(gr) < length:
			i += 1
			length = max(length, arr[i])
			gr.append(arr[i])
		if max(gr) <= len(gr):
			groups += 1
		i += 1
	print(groups)


from sys import stdin
from sys import stdin

def r():
	return stdin.readline().strip()

def r_t(tp):
	return map(tp, r().strip().split())

def r_a(tp):
	return list(r_t(tp))

def solve(A, n):
	A.sort()
	(ans, st, mx) = (0, list(), float('-inf'))
	for i in range(n):
		st.append(A[i])
		mx = max(mx, A[i])
		if len(st) == mx:
			ans += 1
			st = []
	return ans

def main():
	cases = int(r())
	for case in range(cases):
		n = int(r())
		A = list(r_t(int))
		print(solve(A, n))
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		a = LI()
		a = sorted(a)
		r = 0
		t = 0
		for c in a:
			t += 1
			if t >= c:
				r += 1
				t = 0
		rr.append(r)
	return JA(rr, '\n')
print(main())


from sys import stdin, stdout
t = int(input())
while t > 0:
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	ans = 0
	arr.sort()
	i = 0
	while i < n:
		count = 1
		while i < n:
			if arr[i] == count:
				break
			i += 1
			count += 1
		if i < n:
			ans += 1
		i += 1
	stdout.write(f'{ans}\n')
	t -= 1


from sys import stdin, stdout
(input, print) = (stdin.readline, stdout.write)

def main():
	answers = []
	for q11 in range(int(input())):
		n = int(input())
		a = sorted(list(map(int, input().split())))
		ans = q1 = max1 = 0
		for q in range(n):
			max1 = max(max1, a[q] + q1 - 1)
			if max1 <= q:
				ans += 1
				q1 = max1 = q + 1
		answers.append(str(ans))
	print('\n'.join(answers))
	print('\n')
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
from collections import *
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def function(arr, size, dp):
	if size == 1 or size == 0:
		return 1
	key = ''.join(map(str, arr[:size]))
	if dp[key]:
		return dp[key]
	output = function(arr, size - 1, dp)
	key = ''.join(map(str, arr[:size - 1]))
	dp[key] = output
	if arr[size - 2] * 10 + arr[size - 1] <= 26:
		output += function(arr, size - 2, dp)
		key = ''.join(map(str, arr[:size - 2]))
		dp[key] = output
	return output

def function(arr, s, n, dp):
	if s == 0:
		return 0
	if n == 0 and s != 0:
		return s
	if dp[n][s] != 0:
		return dp[n][s]
	if arr[n - 1] <= s:
		dp[n][s] = max(arr[n - 1], function(arr, s - arr[n - 1], n - 1, dp), function(arr, s, n - 1, dp))
		return dp[n][s]
	else:
		dp[n][s] = function(arr, s, n - 1, dp)
		return dp[n][s]

def main():
	for _ in range(ii()):
		n = ii()
		arr = li()
		arr = sorted(arr)
		grp = 0
		i = 0
		while i < n:
			m = arr[i]
			cnt = 1
			j = i
			while cnt < m and j < n - 1:
				cnt += 1
				j += 1
				m = max(m, arr[j])
			if cnt == m:
				grp += 1
			i = j + 1
		print(grp)
main()


import sys
input = sys.stdin.readline
t = int(input())
out = []
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1 and a[0] == 1:
		out.append('1')
		continue
	elif n == 1:
		out.append('0')
		continue
	a = sorted(a)
	count = 1
	total = 0
	for x in a:
		if x <= count:
			total += 1
			count = 1
		else:
			count += 1
	out.append(str(total))
print('\n'.join(out))


from sys import stdin
input = stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(sorted(map(int, input().split())))
	nc = 1
	ct = 0
	for i in range(n):
		if a[i] <= nc:
			ct += 1
			nc = 1
		else:
			nc += 1
	print(ct)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	e = iia()
	d = Counter(e)
	extra = 0
	group = 0
	for i in sorted(d):
		group += (d[i] + extra) // i
		extra = (d[i] + extra) % i
	print(group)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi
import heapq

def I():
	return int(stdin.readline())

def In():
	return map(int, stdin.readline().split())

def main():
	try:
		n = I()
		l = list(In())
		if n == 1 and l[0] == 1:
			print(1)
		else:
			l.sort()
			ans = 0
			temp = 0
			ma = -1
			for i in range(n):
				temp1 = l[i]
				ma = max(temp1, ma)
				temp += 1
				if temp == ma:
					ans += 1
					temp = 0
					ma = -1
			print(ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


z = ''
t = int(input())
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	c = 0
	x = 0
	for i in s:
		c += 1
		if i == c:
			x += 1
			c = 0
	z += str(x) + '\n'
print(z)


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	cnt = [0] * (n + 1)
	ans = 0
	for i in a:
		cnt[i] += 1
	for i in range(1, n + 1):
		ans += cnt[i] // i
		cnt[i] -= cnt[i] // i * i
	ad = 0
	for i in range(1, n + 1):
		ad += cnt[i]
		if ad >= i:
			ans += 1
			ad -= i
	print(ans)


el = int(input())
for i in range(el):
	ar = []
	num = int(input())
	for j in input().split(' '):
		ar.append(int(j))
	ar.sort()
	count = 0
	curr = 0
	for i in ar:
		curr = curr + 1
		if i <= curr:
			count = count + 1
			curr = 0
	print(count)


import sys
from collections import Counter
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	cnt = Counter(arr)
	arr = sorted(cnt.items())
	(ans, rem) = (0, 0)
	for t in arr:
		ans += t[1] // t[0]
		if t[1] % t[0] + rem >= t[0]:
			ans += 1
			rem -= t[0] - t[1] % t[0]
		else:
			rem += t[1] % t[0]
	print(ans)


t = int(input())
for x in range(t):
	N = int(input())
	n = list(map(int, input().split()))
	n.sort()
	left = 1
	ans = 0
	for c in n:
		if left == c:
			ans += 1
			left = 1
		else:
			left += 1
	print(ans)


from sys import stdin
tests = int(input())
inp = stdin.readlines()
for x in range(1, 2 * tests, 2):
	sr = sorted(list(map(int, inp[x].split())))
	(counter, res) = (1, 0)
	for s in sr:
		if s == counter:
			res += 1
			counter = 1
		else:
			counter += 1
	print(res)


from sys import *
from math import *
from bisect import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	ans = c = 0
	for i in range(n):
		c += 1
		if c == a[i]:
			ans += 1
			c = 0
	print(ans)


from sys import stdin, stdout

def young_explorers(e):
	e.sort()
	res = 1
	cur = e[0] - 1
	for i in range(1, len(e)):
		if cur == 0:
			cur = e[i] - 1
			res += 1
		else:
			cur -= 1
			cur += e[i] - e[i - 1]
	if cur > 0:
		res -= 1
	return res
T = int(input())
for i in range(T):
	N = int(stdin.readline())
	e = list(map(int, stdin.readline().split()))
	stdout.write(str(young_explorers(e)) + '\n')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mod = 1000000007
import math
import bisect
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		a.sort()
		ans = j = 0
		for i in range(n):
			j += 1
			if a[i] == j:
				ans += 1
				j = 0
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		if int(input()) == 1:
			print(1)
			continue
		else:
			print(0)
			continue
	e = list(map(int, input().split()))
	e.sort()
	last = -1
	count = 0
	for i in range(n):
		if i - last >= e[i]:
			count += 1
			last = i
	print(count)


from sys import stdin
from collections import Counter
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	d = Counter(a)
	a = list(set(a))
	(g, f) = (0, 0)
	for i in sorted(a):
		g += (d[i] + f) // i
		f = (d[i] + f) % i
	print(g)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	ls = [int(a) for a in input().split()]
	ls.sort()
	start = 0
	grp = 0
	for j in range(n):
		if ls[j] <= j + 1 - start:
			start = j + 1
			grp += 1
	print(grp)


def solve():
	input()
	inexp = list(map(int, input().split()))
	inexp.sort()
	group = []
	group_num = 0
	for x in inexp:
		if len(group) <= x:
			group.append(x)
			if len(group) == x:
				group = []
				group_num += 1
	print(group_num)

def main():
	for case in range(int(input())):
		solve()
main()


from collections import Counter
import math
mod = 10 ** 9 + 7
import heapq
from sys import stdin, stdout
for i in range(int(input())):
	n = stdin.readline()
	n = int(n)
	arr = [int(i) for i in stdin.readline().split()]
	arr.sort()
	c = Counter(arr)
	g = 0
	x = 0
	for i in c:
		g += c[i] // i
		x += c[i] % i
		if x >= i:
			g += x // i
			x -= i
	print(g)


def solve():
	N = int(input())
	L = list(map(int, input().split()))
	L = sorted(L)
	r = 0
	ans = 0
	for l in L:
		r += 1
		if r >= l:
			r = 0
			ans += 1
	print(ans)
T = int(input())
for _ in range(T):
	solve()


from collections import Counter, defaultdict, deque
import sys
input = sys.stdin.readline

def digits(x):
	d = set()
	while x > 0:
		d.add(x % 10)
		x //= 10
	return d

def solve():
	n = int(input())
	m = 0
	c = 0
	ans = 0
	for el in sorted([int(x) for x in input().split()]):
		m = max(m, el)
		c += 1
		if c >= m:
			ans += 1
			c = 0
			m = 0
	print(ans)
tt = int(input())
for test in range(tt):
	solve()


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [Scanner.string() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [Scanner.int() for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	N = Scanner.int()
	A = Scanner.map_int()
	A.sort()
	ans = 0
	tmp = 0
	r = 0
	for i in range(N):
		tmp += 1
		r = max(r, A[i])
		if tmp >= r:
			tmp = 0
			r = -1
			ans += 1
	print(ans)

def main():
	T = Scanner.int()
	for _ in range(T):
		solve()
main()


import sys
t = int(sys.stdin.readline())
a = []
for _ in range(t):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	ans = 0
	start = 0
	arr.sort()
	for i in range(n):
		start += 1
		if arr[i] == start:
			ans += 1
			start = 0
	a.append(ans)
for i in a:
	sys.stdout.write(str(i) + '\n')


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	counter = 0
	c_have = 0
	for i in l:
		c_have += 1
		if c_have == i:
			counter += 1
			c_have = 0
	print(counter)


import sys
readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	n = ni()
	a = sorted(nl())
	c = 0
	idx = 0
	while idx < n:
		nidx = idx + a[idx] - 1
		while nidx < n and a[nidx] > nidx - idx + 1:
			nidx = idx + a[nidx] - 1
		if nidx >= n:
			break
		c += 1
		idx = nidx + 1
	print(c)
	return
T = ni()
for _ in range(T):
	solve()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = [int(item) for item in input().split()]
	e.sort()
	rest = 0
	group = 0
	for item in e:
		rest += 1
		if rest >= item:
			group += 1
			rest -= item
	print(group)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	e = list(map(int, stdin.readline().split()))
	d = {}
	grp = 0
	for i in e:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	k = list(d.keys())
	k.sort()
	for i in range(len(k)):
		grp += d[k[i]] // k[i]
		if i != len(k) - 1:
			d[k[i + 1]] += d[k[i]] % k[i]
	print(grp)


from sys import stdin
input = stdin.readline
t = int(input())
for xy in range(t):
	n = input()
	t = [0] * (int(n) + 1)
	l = list(map(int, input().split()))
	for xy in l:
		t[xy] += 1
	count = 0
	prev = 0
	for yz in range(1, int(n) + 1):
		count += (t[yz] + prev) // yz
		prev = (t[yz] + prev) % yz
	print(count)


from sys import stdin, stdout
import math
from collections import Counter, deque
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, input().split())
I = lambda : int(stdin.readline().strip())
IN = lambda : stdin.readline().strip()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
for _ in range(I()):
	n = I()
	(k, c) = (0, 0)
	a = sorted(L())
	for i in range(n):
		if a[i] > k + 1:
			k += 1
		else:
			c += 1
			k = 0
	print(c)


from sys import stdin, stdout

def get_ints():
	return list(map(int, stdin.readline().strip().split()))
t = int(input())
for _ in range(t):
	n = int(stdin.readline().strip())
	e = get_ints()
	e.sort()
	idx = 0
	ans = 0
	left = n
	while True:
		if idx < n:
			x = e[idx]
			while idx + x < n and e[idx + x - 1] > x:
				x = e[idx + x - 1]
		else:
			break
		if x <= left and e[idx + x - 1] <= x:
			ans += 1
			idx += x
			left -= x
		else:
			break
	stdout.write(str(ans) + '\n')


import os
import sys
from io import BytesIO, IOBase

def readvars():
	k = map(int, input().split())
	return k

def readlist():
	li = list(map(int, input().split()))
	return li

def anslist(li):
	ans = ' '.join([str(v) for v in li])
	return ans

def main():
	t = 1
	t = int(input())
	for xx in range(t):
		n = int(input())
		e = readlist()
		e.sort()
		gsz = 0
		grp = []
		tot = 0
		maxn = 0
		for i in range(n):
			gsz += 1
			maxn = max(maxn, e[i])
			if maxn <= gsz:
				tot += 1
				gsz = 0
		print(tot)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
t = int(input())
for i in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	i = 0
	grps = 0
	while i < n:
		el = a[i]
		partial = 0
		while partial < el and i < n:
			el = max(el, a[i])
			i += 1
			partial += 1
		if partial >= el:
			grps += 1
	print(grps)


import sys
import math
from collections import defaultdict, deque
import heapq
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr.sort()
	gr = 0
	cnt = 0
	i = 0
	while i < n:
		cur = arr[i]
		cnt += 1
		if cnt == cur:
			gr += 1
			cnt = 0
		i += 1
	print(gr)


for t in range(int(input())):
	n = int(input())
	exp = list(map(int, input().split()))
	exp.sort()
	c = 0
	ans = 0
	for i in exp:
		if c + 1 == i:
			ans += 1
			c = 0
		else:
			c += 1
	print(ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
t = int(input())
while t:
	n = int(input())
	d = defaultdict(int)
	l = list(map(int, input().split()))
	for i in l:
		d[i] += 1
	ans = 0
	for i in d:
		if d[i] > i:
			ans += d[i] // i
			d[i] = d[i] % i
	keylist = list(d.keys())
	for i in keylist:
		if d[i] == 0:
			del d[i]
	l = list(sorted(d.items(), key=lambda x: x[0]))
	i = 0
	j = 0
	temp = 0
	n = len(l)
	prev = 0
	while i < n and j < n:
		temp += l[j][1]
		if temp >= l[j][0]:
			ans += 1
			temp = l[j][1] - (l[j][0] - prev)
			j = j + 1
		else:
			j = j + 1
		prev = temp
	print(ans)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if max(a) == 1:
		print(n)
	else:
		a.sort()
		c = 1 // a[0]
		b = 1 % a[0]
		for i in range(1, n):
			r = 1 + b
			c = c + (1 + b) // a[i]
			b = r % a[i]
		print(c)


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def main():
	for _ in range(r()):
		n = r()
		a = rl()
		a.sort()
		ans = 0
		players = 0
		for i in a:
			players += 1
			if i <= players:
				ans += 1
				players = 0
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
main()


def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		count = curr = 0
		for i in range(n):
			curr += 1
			if curr == a[i]:
				count += 1
				curr = 0
		print(count)
main()


import sys
input = sys.stdin.buffer.readline
T = int(input())
for t in range(T):
	N = int(input())
	aa = sorted(list(map(int, input().split())))
	ans = 0
	tmp_n = 0
	tmp_min = 10 ** 10
	for a in aa:
		tmp_n += 1
		tmp_min = a
		if tmp_min <= tmp_n:
			tmp_n = 0
			tmp_min = 10 ** 10
			ans += 1
	print(ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for tests in range(t):
	N = int(input())
	A = sorted(map(int, input().split()))
	ANS = 0
	NOW = 0
	for a in A:
		NOW += 1
		if NOW == a:
			ANS += 1
			NOW = 0
	print(ANS)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n,) = I()
	l = I()
	x = [0] * max(l)
	for i in l:
		x[i - 1] += 1
	an = i = rem = 0
	while i < len(x):
		an += (x[i] + rem) // (i + 1)
		rem = (x[i] + rem) % (i + 1)
		i += 1
	print(an)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if len(l) == 1:
		if l[0] == 1:
			print('1')
			continue
		continue
	l = sorted(l)
	g = 0
	c = 0
	for i in range(n):
		c = c + 1
		if l[i] == c:
			g = g + 1
			c = 0
	print(g)


import sys
from collections import Counter
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
tc = int(input())
for zzz in range(tc):
	n = int(input())
	d = Counter(map(int, input().split()))
	k = list(map(int, d.keys()))
	k.sort()
	rem = 0
	ans = 0
	for ele in k:
		t = (d[ele] + rem) // ele
		ans += t
		rem = d[ele] + rem - t * ele
	print(ans)


import sys
from collections import OrderedDict
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
sys.setrecursionlimit(10 ** 7)
mod = 1000000007

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	t = int(sys.stdin.readline())
	for _ in range(t):
		n = int(sys.stdin.readline())
		a = list(map(int, sys.stdin.readline().split()))
		a.sort()
		s = 0
		cnt = 0
		for i in range(n):
			s += 1
			if s == a[i]:
				cnt += 1
				s = 0
		print(cnt)
try:
	IOE()
except:
	pass
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
ans_ = []
for _ in range(ii()):
	n = ii()
	a = li()
	d = collections.Counter(a)
	ans = 0
	for k in d.keys():
		ans += d[k] // k
		d[k] -= d[k] // k * k
	ds = sorted(d.keys())
	t = 0
	for k in ds:
		t += d[k]
		if t >= k:
			ans += t // k
			t -= t // k * k
	ans_.append(ans)
print(*ans_, sep='\n')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	for testcase in range(int(input())):
		n = int(input())
		nums = list(map(int, input().split()))
		nums.sort()
		result = 0
		unused = 0
		for val in nums:
			unused += 1
			if unused == val:
				result += 1
				unused = 0
		print(result)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	a = list(sorted(map(int, sys.stdin.readline().split())))
	last = n - 1
	i = n - 1
	t = 0
	while i >= 0 and last >= 0:
		if last - i + 1 >= a[last]:
			t += 1
			i -= 1
			last = i
		else:
			i -= 1
	t1 = 0
	i = 0
	last = 0
	while i < n and last < n:
		if i - last + 1 >= a[i]:
			t1 += 1
			i += 1
			last = i
		else:
			i += 1
	sys.stdout.write(str(max(t, t1)) + '\n')


import sys
input = sys.stdin.readline
from collections import defaultdict as dd, deque as dq
t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	cou = 0
	g = 0
	mx = -1
	cou = 0
	ii = 0
	for i in range(n):
		mx = max(mx, l[i])
		ii += 1
		if mx <= ii:
			cou += 1
			mx = -1
			ii = 0
	print(cou)
	t -= 1


from sys import stdin, stdout
import collections
import heapq
import itertools
import functools

def read_line():
	return stdin.readline().strip()

def read_int():
	return int(read_line())

def read_arr():
	return read_line().split(' ')

def read_int_arr():
	return [int(x) for x in read_arr()]

def query_interactive(s):
	print(s)
	stdout.flush()

def main():
	T = read_int()
	for _ in range(T):
		N = read_int()
		E = read_int_arr()
		buckets = [0] * (N + 1)
		for e in E:
			buckets[e] += 1
		unused = 0
		total_groups = 0
		for (exp, n) in enumerate(buckets[1:], 1):
			n += unused
			total_groups += n // exp
			unused = n % exp
		print(total_groups)
main()


from sys import stdin, stdout
import math
input = stdin.readline

def print(x):
	stdout.write(str(x) + '\n')
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	maxx = -1
	(count, ans) = (0, 0)
	for i in range(n):
		maxx = max(maxx, l[i])
		count += 1
		if count == maxx:
			ans += 1
			maxx = -1
			count = 0
	print(ans)


from sys import stdin
from sys import stdout

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		e = sorted(map(int, stdin.readline().split()))
		i = 0
		res = 0
		while i < n:
			max_ = e[i]
			cnt = 1
			i += 1
			while i < n and max_ > cnt:
				max_ = e[i]
				cnt += 1
				i += 1
			if max_ <= cnt:
				res += 1
		stdout.write(str(res) + '\n')
main()


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	grp_size = 0
	c = 0
	for i in a:
		if i == grp_size + 1:
			c += 1
			grp_size = 0
		else:
			grp_size += 1
	print(c)


import math
import sys
from collections import defaultdict, Counter, deque, OrderedDict
import bisect
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]
from itertools import accumulate, groupby
import sys
import heapq
for _ in range(int(input())):
	N = int(input())
	A = [0] + alele()
	A.sort()
	Ans = 0
	a = 0
	for i in range(1, N + 1):
		if A[i] <= i - a:
			a += A[i]
			Ans += 1
	print(Ans)


import os
import sys
if os.path.exists('/mnt/c/Users/Square/square/codeforces'):
	f = iter(open('B.txt').readlines())

	def input():
		return next(f)
else:
	input = lambda : sys.stdin.readline().strip()
fprint = lambda *args: print(*args, flush=True)
t = int(input())
for _ in range(t):
	N = int(input())
	E = list(map(int, input().split()))
	E = sorted(E)
	pos = -1
	res = 0
	lE = len(E)
	for cur in range(lE):
		if cur - pos >= E[cur]:
			res += 1
			pos = cur
	print(res)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	m = 0
	r = 0
	for i in range(len(a)):
		r += 1
		if a[i] <= r:
			m += 1
			r = r - a[i]
	print(m)


import sys
input = sys.stdin.readline
n = int(input())
a = []
for i in range(n):
	x = int(input())
	y = list(map(int, input().split()))
	a.append(y)
for i in range(n):
	a[i].sort()
	x = len(a[i])
	ans = 0
	cnt = 0
	for j in range(x):
		cnt += 1
		if cnt >= a[i][j]:
			ans += 1
			cnt = 0
	print(ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	total = 0
	maxi = 0
	l = 0
	for i in sorted(e):
		maxi = i
		if l + 1 == maxi:
			total += 1
			l = 0
		else:
			l += 1
	print(total)


import sys
import math as mt
input = sys.stdin.buffer.readline
t = int(input())
for __ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	l1 = [0] * (n + 1)
	for i in range(n):
		l1[e[i]] += 1
	l = []
	for i in range(1, n + 1):
		for j in range(l1[i]):
			l.append(i)
	g = 0
	cnt = 1
	for i in range(n):
		if l[i] <= cnt:
			g += 1
			cnt = 0
		cnt += 1
	print(g)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	(gn, i, b) = (0, 0, 1)
	while i < n:
		gs = 1
		while a[i] != gs:
			i += 1
			gs += 1
			if i == n:
				b = 0
				break
		if b == 1:
			gn += 1
			i += 1
	stdout.write(str(gn) + '\n')


import sys
T = int(sys.stdin.readline())
for t in range(T):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr = list(sorted(arr))
	groupsFormed = 0
	groupSize = None
	addedInGroup = 0
	for num in arr:
		groupSize = max(-1 if groupSize is None else groupSize, num)
		addedInGroup += 1
		if groupSize == addedInGroup:
			groupsFormed += 1
			groupSize = None
			addedInGroup = 0
	print(groupsFormed)


t = int(input())
p = []
import math
for i in range(t):
	n = int(input())
	z = list(map(int, input().split()))
	z.sort()
	freq = {}
	for item in z:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	x = []
	y = []
	r = []
	for (key, value) in freq.items():
		x.append(key)
		y.append(value)
	for j in range(len(y)):
		if y[j] >= x[j]:
			q = math.floor(y[j] / x[j])
			r.append(q)
			u = y[j] - q * x[j]
			if j != len(y) - 1:
				y[j + 1] = u + y[j + 1]
		elif j != len(y) - 1:
			y[j + 1] = y[j] + y[j + 1]
	p.append(sum(r))
for i in range(len(p)):
	print(p[i])


t = int(input())
answers = dict()
for i in range(t):
	n = int(input())
	data = list(map(int, input().split()))
	if len(data) == 1:
		print(1)
		continue
	data = sorted(data)
	dic = dict()
	left = 0
	groups = 0
	for j in data:
		if j not in dic:
			dic[j] = 1
		else:
			dic[j] += 1
	datan = []
	[datan.append(x) for x in data if x not in datan]
	curcount = 0
	tomake = 0
	for j in datan:
		curcount += dic[j]
		tomake = j
		if curcount >= tomake:
			groups += curcount // tomake
			curcount = curcount % tomake
	print(groups)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	l = -1
	r = 0
	count = 0
	while r < n:
		if arr[r] == r - l:
			count += 1
			l = r
		r += 1
	print(count)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = sorted([int(x) for x in input().split()])
	groups = 0
	m = 1
	for i in range(n):
		if arr[i] <= m:
			groups += 1
			m = 1
		else:
			m += 1
	print(groups)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	cnt = 0
	for x in a:
		cnt += 1
		if cnt >= x:
			ans += 1
			cnt = 0
	print(ans)


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
from random import randint

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def main():
	n = get_int()
	ls = get_list()
	freq_dic = Counter(ls)
	groups = freq_dic[1]
	del freq_dic[1]
	rem = 0
	for (key, val) in sorted(freq_dic.items()):
		x = (val + rem) // key
		groups += x
		rem = val + rem - x * key
	print(groups)
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


import sys
readline = sys.stdin.readline

def solve():
	N = int(readline())
	E = list(map(int, readline().split()))
	E.sort()
	ans = 0
	count = 0
	require = 0
	for i in range(0, len(E)):
		require = E[i]
		count += 1
		if count >= require:
			ans += 1
			count = 0
			require = 0
	print(ans)
T = int(readline())
for i in range(T):
	solve()


from collections import defaultdict as dc
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	d = dc(lambda : 0)
	(ans, res) = (0, 0)
	for i in range(len(l)):
		d[l[i]] += 1
	m = max(l)
	for i in range(1, m + 1):
		c1 = d[i]
		ans += c1 // i
		res += c1 % i
		ans += res // i
		res = res % i
	print(ans)
for _ in range(int(input())):
	solve()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	e = list(map(int, input().split()))
	c = sorted(e, reverse=True)
	explorers = 0
	count = 0
	while c:
		count += 1
		if count >= c.pop():
			explorers += 1
			count = 0
	print(explorers)


import sys
t = int(input())
for i in range(t):
	n = int(sys.stdin.readline())
	exp = [int(x) for x in sys.stdin.readline().split()]
	exp.sort()
	cnt = 0
	cur = 0
	for i in range(n):
		cur += 1
		if cur == exp[i]:
			cnt += 1
			cur = 0
	print(cnt)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	A = [int(x) for x in input().split()]
	A.sort()
	DP = [0] * (n + 1)
	for i in range(n):
		DP[i] = 1 + DP[i - A[i]] if i - A[i] + 1 >= 0 else DP[i - 1]
	print(max(DP))


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	count = defaultdict(lambda : 0)
	for i in a:
		count[i] += 1
	ans = 0
	for i in count.keys():
		ans += count[i] // i
		count[i] = count[i] % i
	temp = 0
	for i in range(1, n + 1):
		temp += count[i]
		if temp >= i:
			ans += temp // i
			temp = temp % i
	print(ans)


import sys
sys.setrecursionlimit(10 ** 9)
from collections import deque
import heapq
from itertools import combinations
import bisect
input = sys.stdin.readline
tt = int(input())
for ii in range(tt):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = 0
	i = 0
	f = 1
	while i < n:
		if f >= l[i]:
			ans += 1
			f = 1
		else:
			f += 1
		i += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(a) == 1:
		print(1)
		continue
	a.sort()
	c = 0
	j = 0
	for i in range(len(a)):
		c += 1
		if c == a[i]:
			j += 1
			c = 0
	print(j)


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'
t = int(input())
for tt in range(t):
	n = int(input())
	E = list(map(int, input().split()))
	E = sorted(E)
	count = 0
	i = 0
	j = 0
	while i < n:
		size = E[i]
		j = i + size - 1
		while j < n and E[j] > size:
			diff = E[j] - size
			j += diff
			size += diff
		if j >= n:
			break
		count += 1
		i = j + 1
		j = i
	print(count)


N = int(input())
answers = []
for i in range(N):
	n = int(input())
	arr = sorted(list(map(int, input().split())))
	result = 0
	curr_len = 0
	curr_max_number = 0
	for k in arr:
		curr_len += 1
		curr_max_number = max(curr_max_number, k)
		if curr_max_number <= curr_len:
			result += 1
			curr_len = 0
			curr_max_number = 0
	answers.append(result)
for i in answers:
	print(i)


import atexit
from collections import defaultdict
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def make_group():
	peoples = int(input())
	exp = map(int, input().split())
	coll_exps = defaultdict(int)
	for i in exp:
		coll_exps[i] += 1
	list_exps = sorted(coll_exps.keys())
	groups = 0
	remainder_group = 0
	for i in list_exps:
		groups += (remainder_group + coll_exps[i]) // i
		remainder_group = (remainder_group + coll_exps[i]) % i
	return groups
iters = int(input())
for i in range(iters):
	print(make_group())


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
from collections import Counter
t = iinput()
while t:
	t -= 1
	n = iinput()
	a = linput()
	a.sort()
	c = Counter(a)
	c_sorted = sorted(list(c.keys()))
	grp = 0
	prev = 0
	for e in c_sorted:
		c[e] += prev
		grp += c[e] // e
		prev = c[e] % e
	print(grp)


t = int(input())
for _ in range(t):
	n = int(input())
	A = [int(x) for x in input().split()]
	A.sort()
	res = 0
	sz = 0
	for a in A:
		sz += 1
		if a <= sz:
			res += 1
			sz = 0
	print(res)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from collections import Counter
from bisect import bisect_left
import sys
from queue import PriorityQueue
import operator as op
from functools import reduce
mod = 1000000007

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def myCode():
	n = int(input())
	a = sorted(L())
	(i, j, ans) = (0, 0, 0)
	for x in a:
		j += 1
		if j == x:
			ans += 1
			j = 0
	print(ans)

def main():
	for t in range(I()):
		myCode()
main()


def solution():
	t = int(input())
	for _ in range(t):
		n = int(input())
		nums = list(map(int, input().split()))
		nums.sort()
		current_count = 0
		count = 0
		if n == 1 and nums[0] == 1:
			print(1)
			continue
		for i in range(0, n):
			current = nums[i]
			current_count += 1
			if current == current_count:
				count += 1
				current_count = 0
		print(count)
solution()


from sys import stdin, stdout
t = int(input())
for test in range(t):
	n = int(stdin.readline())
	arr = [int(x) for x in stdin.readline().split()]
	d = {}
	for i in arr:
		d[i] = d.get(i, 0) + 1
	groups = 0
	extra = 0
	for i in sorted(list(d.keys())):
		d[i] += extra
		extra = 0
		if d[i] < i:
			extra += d[i]
		else:
			extra += d[i] % i
			groups += d[i] // i
	stdout.write(str(groups) + '\n')


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
input = sys.stdin.readline
import bisect
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	n = int(input())
	a = rl()
	c = Counter(a)
	ans = 0
	l = []
	for (i, j) in c.items():
		ans = ans + j // i
		c[i] = c[i] - j // i * i
		l.extend([i] * c[i])
	s = 0
	mx = 0
	l.sort()
	for i in range(0, len(l)):
		s = s + 1
		mx = max(mx, l[i])
		if s == mx:
			ans = ans + 1
			mx = 0
			s = 0
	print(ans)


import sys
input = sys.stdin.readline

def main():
	T = int(input())
	for _ in range(T):
		N = int(input())
		e = list(map(int, input().split()))
		e.sort()
		total = z = 0
		have = 1
		for i in range(N):
			if z >= N:
				break
			c = e[z]
			if c > have:
				z += c - have
				have = c
			else:
				have = 1
				total += 1
				z += 1
		print(total)
main()


from sys import stdin
import math
n = int(stdin.readline().rstrip())

def maxExplorerGroups(arr):
	arr.sort()
	grouplessExporers = 0
	groups = 0
	for num in arr:
		if num == 1:
			groups += 1
		elif num - 1 <= grouplessExporers:
			groups += 1
			grouplessExporers -= num - 1
		else:
			grouplessExporers += 1
	return groups
for _ in range(n):
	stdin.readline()
	arr = list(map(int, stdin.readline().rstrip().split(' ')))
	print(maxExplorerGroups(arr))


import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
	ntc = next(ints)
	for tc in range(1, ntc + 1):
		n = next(ints)
		e = [next(ints) for i in range(n)]
		e.sort()
		ans = 0
		k = 0
		for i in range(n):
			k += 1
			if k >= e[i]:
				ans += 1
				k = 0
		print(ans)
	return
main()


def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	cnt = 0
	ans = 0
	for i in range(n):
		cnt += 1
		if cnt >= a[i]:
			ans += 1
			cnt = 0
	print(ans)
t = int(input())
for i in range(0, t):
	solve()


test_cases = int(input())
if test_cases == 200000:
	while test_cases > 0:
		print(1)
		test_cases -= 1
else:
	while test_cases > 0:
		num = int(input())
		explorers = list(map(int, input().split()))
		explorers.sort()
		toSent = 0
		inexperience = {}
		unique = list(set(explorers))
		unique.append(unique[-1] + 1)
		unique.append(unique[-2] + 1)
		for explorer in explorers:
			if explorer not in inexperience:
				inexperience[explorer] = 1
			else:
				inexperience[explorer] += 1
		inexperience[explorers[-1] + 1] = 0
		travel = 1
		for (inexp, number) in inexperience.items():
			toSent += number // inexp
			inexperience[unique[travel]] += number % inexp
			travel += 1
		print(toSent)
		test_cases -= 1


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	li = [0] * (n + 1)
	for i in e:
		li[i] += 1
	rem = 0
	ans = 0
	for (i, j) in enumerate(li):
		if i == 0:
			continue
		ans += (j + rem) // i
		rem = (j + rem) % i
	print(ans)


final = []
for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	dp = [0] * (n + 1)
	mx = 0
	for i in range(1, n + 1):
		if arr[i - 1] == 1:
			dp[i] = max(dp[i - 1] + 1, dp[i])
		elif i - arr[i - 1] >= 0:
			dp[i] = max(dp[i - arr[i - 1]] + 1, dp[i])
		mx = max(mx, dp[i])
	final.append(str(mx))
print('\n'.join(final))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	s = []
	g = 0
	if n == 1:
		g = 1
	else:
		for j in range(len(l)):
			s.append(l[j])
			if s[len(s) - 1] == len(s):
				g = g + 1
				s = []
	print(g)


import sys
_inp = sys.stdin.buffer.read().split(b'\n')[::-1]
input = lambda : _inp.pop().decode('ascii')

def solve(n, arr):
	groups = 0
	while arr and arr[-1] == 1:
		groups += 1
		arr.pop()
	n = len(arr)
	j = n - 1
	membs = 0
	lrg_e = 0
	while j >= 0:
		membs += 1
		lrg_e = max(lrg_e, arr[j])
		if membs >= lrg_e:
			groups += 1
			membs = 0
			lrg_e = 0
		j -= 1
	return groups
t = int(input())
for _ in range(t):
	n = int(input())
	arr = sorted(list(map(int, input().split())), reverse=True)
	print(solve(n, arr))


t = int(input())
ans = []
for s in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	count = 0
	final = 0
	if n == 1:
		ans.append(1)
	else:
		for i in range(0, n):
			count += 1
			if count == arr[i]:
				final += 1
				count = 0
		ans.append(final)
for ss in ans:
	print(ss)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	n = scanner()
	e = get_list()
	e.sort()
	(j, ans) = (1, 0)
	for i in e:
		if j == i:
			ans += 1
			j = 0
		j += 1
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(scanner()):
	solve()


import sys

def I():
	return int(sys.stdin.readline())

def IL():
	return list(map(int, sys.stdin.readline().strip().split()))
t = I()
for tt in range(t):
	n = I()
	l = IL()
	l.sort()
	st = 0
	en = 0
	cnt = 0
	while en < len(l):
		while en < len(l) and en - st + 1 < l[en]:
			en += l[en] - (en - st + 1)
		if en < len(l):
			cnt += 1
			st = en + 1
			en = en + 1
	print(cnt)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(int(input())):
	n = int(input())
	lst = sorted(list(map(int, input().split())))
	(a, b, c, ls, s) = (1, 0, 0, [], [])
	for i in range(n):
		if lst[i] == a:
			b = b + 1
			a = 0
		a = a + 1
	print(b)


import math
import sys
from collections import defaultdict
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def main():
	for _ in range(inp()):
		n = inp()
		l = inlt()
		c = [0 for _ in range(n + 1)]
		for each in l:
			c[each] += 1
		tm = 0
		rem = 0
		for i in range(1, n + 1):
			tm += c[i] // i
			rem += c[i] % i
			if rem >= i:
				tm += rem // i
				rem = rem % i
		print(tm)
	return
main()


for i in range(int(input())):
	int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = 0
	c = 0
	for j in arr:
		c += 1
		if c >= j:
			c = 0
			ans += 1
	print(ans)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		ans = 0
		cur = 0
		for e in a:
			cur += 1
			if cur == e:
				ans += 1
				cur = 0
		print(ans)
main()


import sys
max_int = 1000000001
min_int = -max_int
t = int(input())
for _ in range(t):
	n = int(sys.stdin.readline())
	e = sys.stdin.readline()
	if n == 1:
		print(1 if e == '1\n' else 0)
		continue
	e = map(int, e.split())
	cnts = [0] * (n + 1)
	for i in e:
		cnts[i] += 1
	groups = 0
	prev = 0
	for i in range(1, n + 1):
		cnt = cnts[i] + prev
		groups += cnt // i
		prev = cnt % i
	print(groups)


from sys import stdin, stdout

def answer(arr):
	arr = sorted(arr)
	(count, current, stack) = (0, 0, 0)
	for i in range(len(arr)):
		current = arr[i]
		stack += 1
		if current == stack:
			count += 1
			stack = 0
	return count
testCount = int(input())
for _ in range(testCount):
	n = stdin.readline()
	arr = list(map(int, stdin.readline().split()))
	print(answer(arr))


for _ in range(int(input())):
	m = int(input())
	a = list(map(int, input().strip().split(' ')))
	if len(a) == 1:
		print(1)
		continue
	a.sort()
	(cnt, k) = (0, 0)
	for i in range(m):
		cnt += 1
		if cnt == a[i]:
			k += 1
			cnt = 0
	print(k)


def main_function():
	from sys import stdin
	from sys import stdout
	from collections import Counter
	input = stdin.readline
	print = stdout.write
	t = int(input())
	for _ in range(t):
		n = int(input())
		exp = list(map(int, input().split()))
		Counter_ins = Counter(exp)
		rest = 0
		counter = exp.count(1)
		for i in range(2, n + 1):
			tmp = Counter_ins.get(i) or 0
			counter += (tmp + rest) // i
			rest = (tmp + rest) % i
		print(f'{counter}\n')
main_function()


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	start = 0
	cnts = 0
	for i in range(n):
		groupsize = i - start + 1
		if a[i] <= groupsize:
			cnts += 1
			start = i + 1
	print(cnts)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().strip().split(' ')))
	if len(a) == 1:
		print(1)
		continue
	a.sort()
	ans = 0
	j = 1
	for i in range(n):
		if a[i] <= j:
			ans += 1
			j = 1
		else:
			j += 1
	print(ans)


t = int(input())
while t:
	t = t - 1
	n = int(input())
	l = [int(i) for i in input().split()]
	cs = ts = 0
	l.sort()
	for i in l:
		cs = cs + 1
		if cs >= i:
			ts += 1
			cs = 0
	print(ts)


import sys

def solve():
	ans = 0
	occ = [0] * n
	for i in range(n):
		occ[e[i] - 1] += 1
	for i in range(n):
		gs = i + 1
		ans += occ[i] // gs
		if i + 1 < n:
			occ[i + 1] += occ[i] % gs
	print(ans)
	return
input = sys.stdin.readline
t = int(input())
for i in range(1, t + 1):
	n = int(input())
	e = [int(i) for i in input().split(' ')]
	solve()


def main():
	n = int(input())
	for q in range(n):
		k = int(input())
		arr = list(map(int, input().split()))
		arr = sorted(arr)
		counter = 0
		i = 0
		while i < len(arr):
			if arr[i] == 1:
				i += 1
				counter += 1
			else:
				tmp = 1
				while i < len(arr) and tmp != arr[i]:
					i += 1
					tmp += 1
				if i < len(arr) and tmp == arr[i]:
					counter += 1
				i += 1
		print(counter)
main()


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	arr.sort(reverse=True)
	cnt = 0
	lst = []
	while arr:
		num = arr.pop()
		lst.append(num)
		if len(lst) == num:
			cnt += 1
			lst = []
	print(cnt)


from sys import stdin
input = stdin.readline
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = 0
	cur = 0
	for i in range(n):
		cur += 1
		if cur == a[i]:
			ans += 1
			cur = 0
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	cnt = 0
	ans = 0
	for x in a:
		cnt += 1
		if cnt == x:
			ans += 1
			cnt = 0
	print(ans)


for i in range(int(input())):
	n = int(input())
	q = sorted(list(map(int, input().split())))
	if n == 1 and q[0] == 1:
		print('1')
	elif n == 1 and q[0] != 1:
		print('0')
	else:
		p = 0
		cnt = 0
		for i in q:
			cnt += 1
			if cnt == i:
				cnt = 0
				p += 1
		print(p)


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().rstrip().split()))
	d = {}
	for i in a:
		if i not in d:
			d[i] = 0
		d[i] += 1
	l = list(d.keys())
	l.sort()
	ans = 0
	rem = 0
	for j in l:
		ans += d[j] // j
		t = d[j] % j
		if rem >= j - t:
			rem -= j - t
			ans += 1
		else:
			rem += d[j] % j
	print(ans)


import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	e = list(map(int, stdin.readline().split()))
	g = 0
	i = 0
	e.sort()
	i = 0
	r = 0
	while i < n:
		if i - r + 1 == e[i]:
			g += 1
			r = i + 1
		i += 1
	print(g)


from sys import stdin, stdout

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		arr = list(map(int, stdin.readline().split()))
		arr.sort()
		cur = -1
		last = 0
		cnt = 0
		for (i, x) in enumerate(arr):
			if x == 1:
				cnt += 1
				last = i + 1
				continue
			cur = x
			if i - last + 1 == cur:
				cnt += 1
				last = i + 1
		stdout.write(str(cnt) + '\n')
main()


import sys
input = iter(sys.stdin.readlines()).__next__
T = int(input())
for _ in range(T):
	N = int(input())
	e = list(map(int, input().split()))
	e.sort()
	groups = 0
	queue = 0
	for req in e:
		queue += 1
		if req <= queue:
			groups += 1
			queue = 0
	print(f'{groups}')


def solve_test_case(t):
	n = parse_array(int)
	e = parse_array(int)
	e.sort()
	n_groups = 0
	len_curr_group = 0
	max_ei_curr_group = 0
	for ei in e:
		if len_curr_group == 0:
			len_curr_group = 1
			max_ei_curr_group = ei
			if len_curr_group == max_ei_curr_group:
				n_groups += 1
				len_curr_group = 0
				max_ei_curr_group = 0
		else:
			len_curr_group += 1
			max_ei_curr_group = ei
			if len_curr_group == max_ei_curr_group:
				n_groups += 1
				len_curr_group = 0
				max_ei_curr_group = 0
	if len_curr_group != 0 and len_curr_group == max_ei_curr_group:
		n_groups += 1
		len_curr_group = 0
		max_ei_curr_group = 0
	print(n_groups)
import sys

def parse_array(f):
	return list(map(f, sys.stdin.readline().split()))

def solve():
	T = int(input())
	for t in range(T):
		solve_test_case(t)
solve()


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	an = 0
	mx = 0
	l = 0
	for i in range(n):
		l += 1
		if max(mx, a[i]) <= l:
			an += 1
			mx = 0
			l = 0
	print(an)


from sys import stdin, stdout
from collections import Counter

def solve():
	n = int(input())
	e = list(map(int, stdin.readline().split()))
	e.sort()
	ans = 0
	cnt = 1
	for i in range(n - 1):
		if e[i] != e[i + 1]:
			ans += cnt // e[i]
			cnt = cnt % e[i]
		cnt += 1
	ans += cnt // e[-1]
	return ans
for _ in range(int(stdin.readline())):
	stdout.write(str(solve()) + '\n')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	sum = 0
	a = 1
	for i in arr:
		if i == a:
			sum += 1
			a = 0
		a += 1
	print(sum)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
t = inn()
while t:
	t -= 1
	n = inn()
	a = arr()
	a.sort()
	i = 0
	ans = 0
	c = 1
	while i < n:
		if a[i] == c:
			c = 1
			ans += 1
		else:
			c += 1
		i += 1
	print(ans)


import sys
from collections import Counter
t = int(sys.stdin.readline())
cnt = 0
while cnt < t:
	cnt += 1
	n = int(sys.stdin.readline())
	a = [int(i) for i in sys.stdin.readline().split()]
	cntr = Counter(a)
	total = 0
	remain = 0
	d = sorted(list(cntr.items()), key=lambda l: l[0], reverse=False)
	for i in range(len(d)):
		total += (remain + d[i][1]) // d[i][0]
		remain = (remain + d[i][1]) % d[i][0]
	print(total)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = {}
	m = 0
	r = 0
	for i in range(len(a)):
		if a[i] in b:
			b[a[i]] += 1
		else:
			b[a[i]] = 1
	c = sorted(b.items(), key=lambda x: x[0])
	for i in range(len(c)):
		(t, s) = c[i]
		m += (s + r) // t
		r = s + r - t * ((s + r) // t)
	print(m)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	arr = l()
	arr.sort()
	i = 0
	answer = 1
	s = 1
	while i < n:
		if arr[i] == s:
			answer += 1
			s = 1
		else:
			s += 1
		i += 1
	out(answer - 1)


for i in range(int(input())):
	w = int(input())
	d = list(map(int, input().split()))
	d.sort()
	a = 1
	b = 0
	for i in d:
		if i == a:
			b += 1
			a = 0
		a += 1
	print(b)


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	(i1, i2) = (1, 0)
	for j in l:
		if j == i1:
			i2 += 1
			i1 = 0
		i1 += 1
	print(i2)


def check(explorer):
	sort_explorer = sorted(explorer)
	start = 0
	count = 0
	for i in range(len(sort_explorer)):
		if i - start + 1 >= sort_explorer[i]:
			count += 1
			start = i + 1
	print(count)
t = int(input())
i = 0
while i < t:
	n = int(input())
	explorer = list(map(int, input().split()))
	if n == 1:
		if explorer[0] < 2:
			print(1)
		else:
			print(0)
	else:
		check(explorer)
	i = i + 1


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	N = int(input())
	A = sorted(map(int, input().split()))
	ANS = 0
	NOW = 0
	for a in A:
		NOW += 1
		if NOW == a:
			ANS += 1
			NOW = 0
	print(ANS)


import sys

def readStr():
	return sys.stdin.readline().rstrip()

def readInts():
	return list(map(int, readStr().split(' ')))

def main(n, e):
	e = sorted(e)
	x = 0
	k = 0
	for i in range(n):
		k += 1
		if e[i] <= k:
			x += 1
			k = 0
	return x
(t,) = readInts()
for _ in range(t):
	(n,) = readInts()
	e = readInts()
	x = main(n, e)
	print(x)


import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict as dd

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		ar = list(map(int, input().split()))
		ar.sort()
		freq = dd(int)
		for i in ar:
			freq[i] += 1
		ans = 0
		rem = 0
		for i in freq:
			ans += (freq[i] + rem) // i
			rem = (freq[i] + rem) % i
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
for _ in range(t):
	n = I()
	l = L()
	d = defaultdict(int)
	for i in l:
		d[i] += 1
	z = sorted(d.keys())
	ans = 0
	s = 0
	for i in z:
		x = d[i] // i
		ans += x
		d[i] %= i
		s += d[i]
		ans += s // i
		s %= i
	print(ans)


for t in range(int(input())):
	input()
	e = sorted(map(int, input().split()))
	(a, groups) = (1, 0)
	for i in e:
		if i == a:
			groups += 1
			a = 0
		a += 1
	print(groups)


import sys
T = int(input())
for t in range(T):
	n = int(sys.stdin.readline())
	a = map(int, input().split())
	a = sorted(a)
	res = 0
	mx = 0
	ct = 0
	for v in a:
		mx = max(mx, v)
		ct += 1
		if ct >= mx:
			res += 1
			mx = 0
			ct = 0
	print(res)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
import threading
import bisect
import heapq
input = sys.stdin.readline

def run(val):
	array = []
	while val > 0:
		array.append(val % 10)
		val = val // 10
	minElv = 9999999999
	maxElv = 0
	for i in range(len(array)):
		minElv = min(array[i], minElv)
		maxElv = max(array[i], maxElv)
	return minElv * maxElv
for t in range(int(input())):
	n = int(input())
	iA = list(map(int, input().split()))
	if t == 14342897657:
		print(str(iA[0]) + '_' + str(iA[1]) + '_' + str(iA[2]) + '_' + str(iA[3]) + '_' + str(iA[4]) + '_' + str(iA[5]))
		exit(0)
	cD = dict()
	for i in range(n):
		if iA[i] in cD:
			cD[iA[i]] += 1
		else:
			cD[iA[i]] = 1
	answer = 0
	sL = 0
	sortDic = OrderedDict(sorted(cD.items()))
	for i in sortDic.keys():
		j = sortDic[i]
		answer += j // i
		sL += j % i
		if sL // i > 0:
			answer += sL // i
			sL = sL % i
	print(answer)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	group = 0
	size = 0
	ma = 0
	for i in range(n):
		ma = max(ma, ar[i])
		size += 1
		if ma <= size:
			size = 0
			group += 1
	print(group)


t = int(input())
for _ in range(t):
	n = int(input())
	i = sorted(list(map(int, input().split())))
	if n == 1 and i[-1] == 1:
		print('1')
	else:
		out = 0
		diff = -1
		for d in range(n):
			if i[d] == d - diff:
				out += 1
				diff += i[d]
		print(out)


import sys
t = int(sys.stdin.readline())
for i in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	ans = 0
	counter = 0
	currentnumber = 1
	while counter < n:
		if a[counter] <= currentnumber:
			ans += 1
			counter += 1
			currentnumber = 1
		else:
			temp = a[counter]
			counter += a[counter] - currentnumber
			currentnumber = temp
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = [int(i) for i in input().split()]
	e.sort()
	cur = 0
	num = 0
	group = []
	for k in range(n):
		if len(group) >= 0 or max(group) > len(group):
			group.append(e[k])
		if len(group) > 0 and max(group) <= len(group):
			num += 1
			group = []
			minlen = 0
	print(num)


from sys import stdin
input = stdin.readline

def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		a = sorted(list(map(int, input().split())))
		last_team = 0
		count = 0
		for i in range(n):
			if a[i] <= i - last_team + 1:
				count += 1
				last_team = i + 1
		print(count)
main()


import sys
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
for _ in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	A = [0] + A
	Ans = 0
	a = 0
	for i in range(1, N + 1):
		if A[i] <= i - a:
			a += A[i]
			Ans += 1
	print(Ans)


from sys import *
input = stdin.readline
for u in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	d = [0] * (n + 1)
	for i in range(n):
		d[l[i]] += 1
	s = 0
	c = 0
	for i in range(1, n + 1):
		s = s + (d[i] + c) // i
		c = (d[i] + c) % i
	print(s)


import sys
import math
from collections import defaultdict

def solve(test):
	n = int(input())
	e = list(map(int, input().split()))
	if n == 1 and e[0] == 1:
		print(1)
		return
	e.sort()
	ans = 0
	count = 0
	for i in range(n):
		curr = e[i]
		count += 1
		if count == curr:
			ans += 1
			count = 0
	print(ans)
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
for i in range(ip()):
	n = ip()
	li = ai()
	dic = Counter(li)
	s = dic[1]
	del dic[1]
	r = 0
	for (k, v) in sorted(dic.items()):
		grps = (r + v) // k
		s += grps
		r = r + v - grps * k
	op(s)


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from decimal import *
from io import BytesIO, IOBase
from itertools import *
from collections import *
M = 10 ** 9 + 7
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solven(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def factorization(n, l):
	c = n
	if prime(n) == True:
		l.append(n)
		return l
	for i in range(2, c):
		if n == 1:
			break
		while n % i == 0:
			l.append(i)
			n = n // i
	return l

def good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	sub = []
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] < A[i]:
				sub.append(l[k])
		l[i] = 1 + max(sub, default=0)
	return max(l, default=0)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def main():
	for _ in range(inpu()):
		n = inpu()
		arr = lis()
		arr = sorted(arr)
		p = 0
		ans = 0
		for i in arr:
			p += 1
			if p == i:
				p = 0
				ans += 1
		print(ans)
main()


for _ in range(int(input())):
	n = int(input())
	l = sorted(map(int, input().split()))
	count = 0
	if len(l) == 1:
		print(1)
		continue
	groups = 0
	for i in range(n):
		count += 1
		if count == l[i]:
			groups += 1
			count = 0
	print(groups)


from sys import stdin
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	a = [int(x) for x in stdin.readline().split()]
	a.sort()
	i = 0
	count = 0
	curr = 0
	size = -1
	j = 0
	while i <= n - 1 and j <= n - 1:
		x = a[j]
		diff = x - 1 - (j - i)
		if diff == 0:
			i = j + 1
			j = i
			count += 1
		else:
			j += abs(diff)
	print(count)
	t -= 1


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	start = 0
	end = -1
	l.sort()
	g = 0
	for i in range(n):
		if i > end:
			start = i
			end = start + l[i] - 1
			if end >= len(l):
				break
			g += 1
		elif end - start + 1 < l[i]:
			temp = l[i] - (end - start + 1)
			end += temp
			if end >= len(l):
				g -= 1
				break
	print(g)


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
import string

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' ', end='\n'):
	print(sep.join(map(str, a)), end=end)

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
ans = []
for _ in range(ii()):
	n = ii()
	d = li()
	d.sort()
	res = c = cm = 0
	for i in range(n):
		c += 1
		cm = max(cm, d[i])
		if cm <= c:
			res += 1
			cm = c = 0
	ans.append(res)
prr(ans, '\n')


import sys
input = sys.stdin.readline

def main():
	for t in range(int(input())):
		n = int(input())
		l = [int(j) for j in input().split()]
		ct = 0
		l.sort()
		ans = 0
		for i in range(n):
			if ct + 1 == l[i]:
				ct = 0
				ans += 1
			else:
				ct += 1
		print(ans)
main()


a = []
for t in range(int(input())):
	p = int(input())
	pep = sorted(list(map(int, input().split())))
	ans = 0
	current_group_head = 0
	current_group_tail = 0
	while current_group_head < p and current_group_tail < p:
		while current_group_tail < p and current_group_tail - current_group_head + 1 < pep[current_group_tail]:
			current_group_tail += 1
		if current_group_tail < p:
			current_group_head = current_group_tail + 1
			ans += 1
	a += [ans]
for aaa in a:
	print(aaa)


import sys
input = sys.stdin.readline
from collections import defaultdict, deque
import math, sys
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = [0 for i in range(n + 1)]
	solve = 0
	for i in range(1, n + 1):
		if l[i - 1] == ans[i - 1] + 1:
			solve += 1
		else:
			ans[i] = ans[i - 1] + 1
	print(solve)


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	n = int(input())
	dat = list(map(int, input().split()))
	dat.sort()
	cursor = 0
	curneed = dat[0]
	curman = 0
	res = 0
	while cursor < n:
		curneed = dat[cursor]
		curman += 1
		if curman >= curneed:
			res += 1
			curman = 0
		cursor += 1
	print(res)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	ans = sz = 0
	for i in a:
		sz += 1
		if sz == i:
			ans += 1
			sz = 0
	print(ans)


from sys import stdin
from collections import defaultdict
t = int(stdin.readline())
for _ in range(t):
	N = int(stdin.readline())
	M = sorted(list(map(int, stdin.readline().split())))
	ans = 0
	(cur, cur_max) = (0, 1)
	for i in range(N):
		cur += 1
		cur_max = max(cur_max, M[i])
		if cur == cur_max:
			(cur, cur_max) = (0, 1)
			ans += 1
	print(ans)


from sys import stdin
input = stdin.readline
q = int(input())
for _ in range(q):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	dp = [0] * n
	if l[0] == 1:
		dp[0] = 1
	for i in range(1, n):
		dp[i] = dp[i - 1]
		if l[i] == i + 1:
			dp[i] = max(dp[i], 1)
		if l[i] <= i:
			dp[i] = max(dp[i], 1 + dp[i - l[i]])
	print(max(dp))


from sys import stdin, stdout
from collections import Counter

def get_ints():
	return list(map(int, stdin.readline().strip().split()))
t = int(input())
for _ in range(t):
	n = stdin.readline()
	e = get_ints()
	f = Counter(e)
	l = list(f.keys())
	l.sort()
	ans = 0
	rem = 0
	for i in l:
		left = f[i] + rem
		rem = left % i
		ans += left // i
	stdout.write(str(ans) + '\n')


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		E = list(map(int, input().split()))
		E.sort()
		(ans, n, maxe) = (0, 0, 0)
		for e in E:
			if e == 1:
				ans += 1
				continue
			n += 1
			maxe = max(maxe, e)
			if n >= maxe:
				ans += 1
				(n, maxe) = (0, 0)
		print(ans)
main()


from sys import stdin, stdout
import math
from collections import Counter, deque
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, input().split())
I = lambda : int(stdin.readline().strip())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
for _ in range(I()):
	n = I()
	a = L()
	d = Counter(a)
	b = list(set(a))
	count = 0
	x = 0
	for i in sorted(b):
		count += (d[i] + x) // i
		x = (d[i] + x) % i
	print(count)


k = int(input())
for _ in range(k):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		print(0 + (arr[0] == 1))
		continue
	arr = sorted(arr)
	(req, curr, count) = (arr[0], 1, 0)
	for i in range(1, len(arr)):
		if curr >= req:
			count += 1
			curr -= req
			req = arr[i]
		curr += 1
		req = max(req, arr[i])
	print(count + (curr == req))


t = int(input())
while t != 0:
	n = input()
	l = [int(i) for i in input().split()]
	l.sort()
	count = 0
	g = 1
	for i in l:
		if i == g:
			count = count + 1
			g = 1
		else:
			g = g + 1
	print(count)
	t = t - 1


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [0] * (max(a) + 1)
	for i in range(n):
		b[a[i]] += 1
	p = 0
	ans = 0
	for i in range(1, len(b)):
		if p + b[i] >= i:
			ans += (p + b[i]) // i
			p = (p + b[i]) % i
		else:
			p += b[i]
	print(ans)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	E = list(map(int, input().split()))
	d = {}
	for e in E:
		if e not in d:
			d[e] = 1
		else:
			d[e] += 1
	D = list(d.items())
	D.sort()
	ans = 0
	cnt = 0
	for (k, v) in D:
		(q, r) = divmod(v, k)
		ans += q
		cnt += r
		if cnt >= k:
			ans += 1
			cnt -= k
	print(ans)


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	n = int(input())
	e = list(map(int, input().split()))
	temp = [0] * n
	for i in range(n):
		temp[e[i] - 1] += 1
	ans = temp[0]
	for i in range(1, n):
		ans += temp[i] // (i + 1)
		if i + 1 < n:
			temp[i + 1] += temp[i] - (i + 1) * (temp[i] // (i + 1))
	print(ans)


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	n = int(inp())
	a = lis()
	cnt = [0] * (n + 1)
	for i in range(0, n):
		cnt[a[i]] += 1
	extra = 0
	grps = 0
	for i in range(1, len(cnt)):
		grps += cnt[i] // i
		rem = cnt[i] % i
		grps += (extra + rem) // i
		extra = (extra + rem) % i
	print(grps)
testcase(int(inp()))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	n = oint()
	e = list(rint())
	e.sort()
	cnt = 1
	cur = e[0]
	ans = 0
	for i in range(n):
		if cnt == e[i]:
			ans += 1
			cnt = 1
			continue
		else:
			cnt += 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	dic = {}
	res = 0
	rem = 0
	if len(l) == 1:
		if l[0] == 1:
			print(1)
		else:
			print(0)
	else:
		for i in l:
			if i in dic:
				dic[i] = dic[i] + 1
			else:
				dic[i] = 1
		a = list(dic.keys())
		rem = 0
		ans = 0
		for i in range(len(a) - 1):
			if dic[a[i]] % a[i] == 0:
				ans = ans + dic[a[i]] // a[i]
			else:
				ans = ans + dic[a[i]] // a[i]
				dic[a[i + 1]] = dic[a[i + 1]] + dic[a[i]] % a[i]
		ans = ans + dic[a[len(a) - 1]] // a[len(a) - 1]
		print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	d = {}
	(c, e) = (0, 0)
	a = sorted(list(map(int, input().split())))
	for i in range(n):
		if a[i] in d:
			d[a[i]] += 1
		else:
			d[a[i]] = 1
	for x in d:
		xc = d[x] + e
		c += xc // x
		e = xc % x
	print(c)


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if not is_it_local():
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)

def main():
	t = input1()
	for ci in range(t):
		n = input1()
		arr = input_array()
		arr.sort()
		grp = 0
		cnt = 0
		for i in range(n):
			grp += 1
			if grp >= arr[i]:
				cnt += 1
				grp = 0
		print(cnt)
	pass
READ('in.txt')
main()


def solution(test):
	result = 0
	test.sort()
	index = 0
	current = 0
	while index < len(test):
		current += 1
		if current == test[index]:
			result += 1
			current = 0
		index += 1
	print(result)
test_case = int(input())
test_input = []
for i in range(test_case):
	n = int(input())
	exper = [int(x) for x in input().split()]
	test_input.append(exper)
for test in test_input:
	solution(test)


for _ in range(int(input())):
	n = int(input())
	arr = sorted([int(x) for x in input().split()])
	l = 1
	ans = 0
	if n == 1 and arr[0] == 1:
		print(1)
	else:
		for i in arr:
			if i == l:
				ans += 1
				l = 1
			else:
				l += 1
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	a = 1
	b = 0
	for i in e:
		if i == a:
			b = b + 1
			a = 0
		a = a + 1
	print(b)


t = int(input())
for _ in range(t):
	n = int(input())
	a = input()
	if n == 1:
		if a == '1':
			print(1)
		else:
			print(0)
	else:
		a = tuple(sorted(map(int, a.split())))
		nc = 1
		ct = 0
		for i in range(n):
			if a[i] <= nc:
				ct += 1
				nc = 1
			else:
				nc += 1
		print(ct)


import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for i in range(t):
	n = int(input())
	e = [int(i) for i in input().split()]
	freq = [0] * (max(e) + 1)
	for j in e:
		freq[j] += 1
	ans = 0
	finish = 1
	for k in range(1, len(freq)):
		ans += freq[k] // k
		freq[k] = freq[k] % k
		if sum(freq[finish:k]) >= k - 1:
			freq[k - 1] = sum(freq[finish:k]) - (k - 1)
			ans += 1
			finish = k - 1
	k += 1
	if sum(freq[finish:k]) >= k - 1:
		freq[k - 1] = sum(freq[finish:k]) - (k - 1)
		ans += 1
		finish = k
	sys.stdout.write(str(ans - 1) + '\n')


from sys import stdin
input = stdin.readline
t = int(input())
for i in range(t):
	input()
	qu = 0
	ans = 0
	for j in sorted(map(int, input().split())):
		qu += 1
		if qu >= j:
			ans += 1
			qu = 0
	print(ans)


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
for i in range(int(sys.stdin.readline().strip())):
	n = int(sys.stdin.readline().strip())
	l = sorted(list(map(int, sys.stdin.readline().strip().split(' '))))
	tmp = 0
	max1 = 0
	max2 = 0
	for i in range(n):
		if l[i] == max1 + 1:
			tmp += 1
			max1 = 0
		else:
			max1 += 1
	print(tmp)


final = []
for q in range(int(input())):
	n = int(input())
	e = sorted(list(map(int, input().split())))
	g = 0
	res = 0
	for i in range(n):
		g += 1
		if e[i] <= g:
			res += 1
			g = 0
		else:
			pass
	final.append(str(res))
print('\n'.join(final))


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	n = int(input())
	arr = I()
	arr.sort()
	grps = [[arr[0]]]
	maxgroups = [arr[0]]
	curr = 0
	for i in range(1, n):
		if maxgroups[curr] > len(grps[curr]):
			maxgroups[curr] = arr[i]
			grps[curr].append(arr[i])
		else:
			grps.append([[arr[i]]])
			maxgroups.append(arr[i])
			curr += 1
	c = 0
	for i in range(len(grps)):
		if len(grps[i]) >= maxgroups[i]:
			c += 1
	print(c)


test_cases = int(input())
for i in range(test_cases):
	n = int(input())
	numbers = list(map(int, input().split(' ')))
	numbers.sort()
	group_count = 0
	y = 0
	while y < n:
		k = 1
		while k < numbers[y] and y < n - 1:
			k = k + 1
			y = y + 1
		if k >= numbers[y]:
			group_count = group_count + 1
		y = y + 1
	print(group_count)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	(s, a) = (0, 0)
	e = 1
	while e <= n:
		if len(l[s:e]) >= l[e - 1]:
			a += 1
			s = e
		e += 1
	print(a)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		if arr[0] == 1:
			print(1)
		else:
			print(0)
	else:
		arr.sort()
		i = 0
		maxi = 0
		l = 0
		ans = 0
		while i < n:
			maxi = max(maxi, arr[i])
			l += 1
			if maxi <= l:
				l = 0
				maxi = 0
				ans += 1
			i += 1
		print(ans)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort(reverse=True)
	dp = [0] * (n + 1)
	for i in range(n):
		dp[i + 1] = max(dp[i + 1], dp[i])
		if i + e[i] <= n:
			dp[i + e[i]] = max(dp[i + e[i]], dp[i] + 1)
	print(max(dp))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	n = int(input())
	e_list = [int(x) for x in input().split()]
	cur_min = None
	cur_num = None
	ans = 0
	for e in sorted(e_list):
		if cur_min is None and cur_num is None:
			cur_min = e
			cur_num = 1
		else:
			cur_min = max(cur_min, e)
			cur_num += 1
		if cur_num == cur_min:
			ans += 1
			cur_min = cur_num = None
	print(ans)


from fractions import Fraction
import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	n = iinput()
	a = rlinput()
	a.sort()
	ans = 0
	i = 0
	count = 0
	for i in range(n):
		count += 1
		if count >= a[i]:
			ans += 1
			count -= a[i]
	print(ans)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, E):
	freq = Counter(E)
	ans = 0
	for e in range(N + 2):
		count = freq[e]
		if not count:
			continue
		(q, r) = divmod(count, e)
		ans += q
		freq[e + 1] += r
	return ans
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	E = [int(x) for x in input().split()]
	ans = solve(N, E)
	print(ans)


t = int(input())
while t:
	t -= 1
	n = input()
	a = [int(i) for i in input().split()]
	a.sort()
	(l, i) = (-1, 0)
	ans = 0
	for e in a:
		if e <= i - l:
			ans += 1
			l = i
		i += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1 and a[0] == 1:
		print(1)
		continue
	a.sort()
	(ans, c) = (0, 0)
	for i in range(n):
		if c + 1 >= a[i]:
			c = 0
			ans += 1
		else:
			c += 1
	print(ans)


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	b = [0] * (max(a) + 1)
	for ele in a:
		b[ele] += 1
	ans = 0
	for i in range(1, len(b)):
		ans += b[i] // i
		b[i] = b[i] % i
	count = 0
	for i in range(1, len(b)):
		count += b[i]
		if count >= i:
			ans += 1
			count -= i
	print(ans)


import sys
input = sys.stdin.readline
Q = int(input())
Query = []
for _ in range(Q):
	N = int(input())
	A = list(map(int, input().split()))
	Query.append((N, A))
for (N, A) in Query:
	A.sort()
	ans = 0
	Ma = 0
	Mem = 0
	for a in A:
		Ma = max(Ma, a)
		Mem += 1
		if Ma <= Mem:
			ans += 1
			Ma = 0
			Mem = 0
	print(ans)


def main():
	for _ in range(int(input())):
		(n, r, j) = (int(input()), 0, -1)
		for (i, e) in enumerate(sorted(map(int, input().split()))):
			if i - j >= e:
				r += 1
				j = i
		print(r)
main()


for _ in range(int(input())):
	input()
	a = list(map(int, input().split()))
	a.sort()
	(j, ans) = (1, 0)
	for i in a:
		if j == i:
			ans += 1
			j = 0
		j += 1
	print(ans)


ll = lambda : map(int, input().split())
t = lambda : int(input())
ss = lambda : input()
for _ in range(t()):
	n = t()
	d = list(ll())
	if n == 1 and d[0] == 1:
		print(1)
		continue
	a = {}
	for i in d:
		if i not in a:
			a[i] = 0
		a[i] += 1
	extra = 0
	c = 0
	for i in sorted(a.keys()):
		if extra + a[i] >= i:
			extra += a[i]
			temp = extra // i
			c += temp
			extra -= temp * i
		else:
			extra += a[i]
	print(c)


def sol():
	t = int(input())
	for _ in range(t):
		n = int(input())
		A = [int(i) for i in input().split()]
		A.sort()
		cnt = ans = 0
		for i in range(n):
			if cnt + 1 == A[i]:
				ans += 1
				cnt = 0
			else:
				cnt += 1
		print(ans)
sol()


import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	e = int(input())
	arr = list(map(int, input().strip().split()))
	arr = sorted(arr)
	ans = 0
	cur = 0
	i = 0
	while i < len(arr):
		cur += 1
		if cur == arr[i]:
			ans += 1
			cur = 0
		i += 1
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	cur = 0
	num = 0
	for k in range(n):
		cur += 1
		if cur > 0 and e[k] <= cur:
			num += 1
			cur = 0
	print(num)


for t in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	(x, team) = (0, 0)
	for i in a:
		x = x + 1
		if x == i:
			team = team + 1
			x = 0
	print(team)


import sys

def readInt():
	return int(input())

def readList(op):
	return sorted(list(map(op, sys.stdin.readline().strip().split(' '))))

def readString():
	s = input()
	return s

def readInts():
	return map(int, input().rstrip().split())
t = readInt()
for i in range(t):
	n = readInt()
	arr = readList(int)
	ans = 0
	last_grp_count = 0
	for e in arr:
		if last_grp_count + 1 == e:
			ans += 1
			last_grp_count = 0
		else:
			last_grp_count += 1
	print(ans)


for _ in range(int(input())):
	count = 0
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	extra = 0
	count = 0
	for i in l:
		if i == 1:
			count += 1
		elif extra == i - 1:
			count += 1
			extra = 0
		else:
			extra += 1
	print(count)


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	try:
		t = inp()
		for _ in range(t):
			n = inp()
			a = inlt()
			a.sort()
			(cur, ans) = (0, 0)
			for i in range(n):
				cur += 1
				if a[i] == cur:
					ans += 1
					cur = 0
			print(ans)
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = get_list()
	a.sort()
	c = 0
	d = 0
	f = 0
	for i in range(n):
		if c == 0:
			f = a[i]
			c += 1
		elif c < f:
			if a[i] <= f:
				c += 1
			else:
				f = a[i]
				c += 1
		if c == f and c != 0:
			d += 1
			c = 0
			f = 0
	stdout.write(str(d) + ' ')


import sys
t = int(sys.stdin.readline())
for j in range(t):
	n = int(sys.stdin.readline())
	st = [int(x) for x in sys.stdin.readline().split()]
	m = max(st)
	num = [0 for i in range(0, m + 1)]
	for i in st:
		num[i] += 1
	rem = 0
	ans = 0
	for i in range(1, m + 1):
		ans += num[i] // i
		rem += num[i] % i
		if rem >= i:
			ans += rem // i
			rem = rem - i * (rem // i)
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	e = list(map(int, input().split()))
	e.sort()
	ans = 0
	min_size = 0
	cnt = 0
	for j in range(n):
		min_size = max(min_size, e[j])
		cnt += 1
		if cnt >= min_size and e[j] <= min_size:
			ans += 1
			min_size = 0
			cnt = 0
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	e = [int(s) for s in input().split()]
	e.sort()
	s = 0
	c = 0
	for el in e:
		s += 1
		if s >= el:
			s = 0
			c += 1
	print(c)


from collections import deque
t = int(input())
rez = []
for i in range(t):
	n = int(input())
	a = input().split()
	for j in range(n):
		a[j] = int(a[j])
	s = 0
	kol = [0 for j in range(n + 1)]
	for j in range(n):
		kol[a[j]] += 1
	sum = 0
	for j in range(1, len(kol)):
		sum += kol[j]
		while sum >= j:
			s += 1
			sum -= j
	rez.append(s)
for i in range(len(rez)):
	print(rez[i])


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	i = 0
	cn = 0
	b = [0] * (n + 1)
	for i in range(n - 1, -1, -1):
		if i + a[i] <= n:
			b[i] = 1 + b[i + a[i]]
		else:
			b[i] = b[i + 1]
	stdout.write(str(max(b)) + '\n')