I = int(eval(input()))

from collections import Counter

from itertools import accumulate

As = list(map(int, input().split()))

xs = sorted([x for x in list(Counter(As).values())]) + [10**18]

Xs = accumulate(xs)



def bsearch(target, min_i, max_i, func):

    # func(index) <= target < func(index+1) となるindexを返す

    if func(max_i) <= target:

        return max_i

    if target < func(min_i):

        return min_i - 1

    index = (max_i + min_i)//2

    while True:

        if func(index) <= target:

            if target < func(index+1):

                return index

            index, min_i = (index+1 + max_i)//2, index+1

            continue

        index, max_i = (index-1 + min_i)//2, index-1



#for x in xs:

N = len(xs) - 1

rs = [0]*I

mny = N+1

for l, (x, X) in enumerate(zip(xs[1:], Xs)):

    l += 2

    y = bsearch(0, N-l+2, N+1, lambda k: x > X//(k-(N-l+1)))

    y+=1

    #print(l, y, X//(y-(N-l+1)))

    for i in range(y, mny):

        rs[i-1] = X//(i-(N-l+1))

    mny = min(y, mny)

for r in rs:

    print(r)
I = int(eval(input()))

from collections import Counter

from itertools import accumulate

As = list(map(int, input().split()))

xs = sorted([x for x in list(Counter(As).values())]) + [10**18]

Xs = accumulate(xs)



N = len(xs) - 1

rs = [0]*I

mny = N+1

for l, (x, X) in enumerate(zip(xs[1:], Xs)):

    l += 2

    y = X//(x+1) + (N-l+1) + 1

    if y-(N-l+1) > 0 and x <= X//(y-(N-l+1)):

        y+=1

    for i in range(y, mny):

        rs[i-1] = X//(i-(N-l+1))

    mny = min(y, mny)

for r in rs:

    print(r)
I = int(eval(input()))
from collections import Counter
from itertools import accumulate

As = list(map(int, input().split()))
xs = sorted([x for x in list(Counter(As).values())]) + [10**18]
Xs = accumulate(xs)


def bsearch(target, min_i, max_i, func):
    # func(index) <= target < func(index+1) となるindexを返す
    if func(max_i) <= target:
        return max_i
    if target < func(min_i):
        return min_i - 1
    index = (max_i + min_i) // 2
    while True:
        if func(index) <= target:
            if target < func(index + 1):
                return index
            index, min_i = (index + 1 + max_i) // 2, index + 1
            continue
        index, max_i = (index - 1 + min_i) // 2, index - 1


# for x in xs:
N = len(xs) - 1
rs = [0] * I
mny = N + 1
for l, (x, X) in enumerate(zip(xs[1:], Xs)):
    l += 2
    y = bsearch(0, N - l + 2, N + 1, lambda k: x > X // (k - (N - l + 1)))
    y += 1
    # print(l, y, X//(y-(N-l+1)))
    for i in range(y, mny):
        rs[i - 1] = X // (i - (N - l + 1))
    mny = min(y, mny)
for r in rs:
    print(r)

I = int(eval(input()))
from collections import Counter
from itertools import accumulate

As = list(map(int, input().split()))
xs = sorted([x for x in list(Counter(As).values())]) + [10**18]
Xs = accumulate(xs)
N = len(xs) - 1
rs = [0] * I
mny = N + 1
for l, (x, X) in enumerate(zip(xs[1:], Xs)):
    l += 2
    y = X // (x + 1) + (N - l + 1) + 1
    if y - (N - l + 1) > 0 and x <= X // (y - (N - l + 1)):
        y += 1
    for i in range(y, mny):
        rs[i - 1] = X // (i - (N - l + 1))
    mny = min(y, mny)
for r in rs:
    print(r)

- - -def bsearch(target, min_i, max_i, func): -    # func(index) <= target < func(index+1) となるindexを返す -    if func(max_i) <= target: -        return max_i -    if target < func(min_i): -        return min_i - 1 -    index = (max_i + min_i) // 2 -    while True: -        if func(index) <= target: -            if target < func(index + 1): -                return index -            index, min_i = (index + 1 + max_i) // 2, index + 1 -            continue -        index, max_i = (index - 1 + min_i) // 2, index - 1 - - -# for x in xs: -    y = bsearch(0, N - l + 2, N + 1, lambda k: x > X // (k - (N - l + 1))) -    y += 1 -    # print(l, y, X//(y-(N-l+1))) +    y = X // (x + 1) + (N - l + 1) + 1 +    if y - (N - l + 1) > 0 and x <= X // (y - (N - l + 1)): +        y += 1