from collections import Counter

from itertools import groupby





def bin_search(k, greater_count, smaller_sum):

    l = 0

    r = n + 1

    while l < r - 1:

        m = (l + r) // 2

        gc = greater_count[m]

        ss = smaller_sum[m]

        if gc + ss // m >= k:

            l = m

        else:

            r = m

    return l





n = int(eval(input()))

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

cnt = sorted(Counter(aaa).values())



# Precompute

greater_count = [0] * (n + 2)  # Number of types of Ai same or greater than i

smaller_sum = [n] * (n + 2)  # Number of Ai smaller than i



remain = greater_count[1] = len(cnt)

total = smaller_sum[1] = 0



cnt_grp = [(c, len(list(itr))) for c, itr in groupby(cnt)]



for (c, l), (c2, _) in zip(cnt_grp, cnt_grp[1:]):

    remain -= l

    total += c * l

    for i in range(c + 1, c2 + 1):

        greater_count[i] = remain

        smaller_sum[i] = total



# print(greater_count)

# print(smaller_sum)



# Query

buf = []

for k in range(1, len(cnt) + 1):

    buf.append(bin_search(k, greater_count, smaller_sum))



buf.extend([0] * (n - len(cnt)))



print((*buf))

from collections import Counter

from itertools import groupby, accumulate



n = int(eval(input()))

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

cnt = sorted(Counter(aaa).values())



remain = len(cnt)

total = 0

kkk = [0] * (n + 1)

p = 1



for c, itr in groupby(cnt):

    l = len(list(itr))

    for i in range(p, c + 1):

        kkk[remain + total // i] = i

    remain -= l

    total += c * l

    p = c + 1



for i in range(p, n + 1):

    kkk[remain + total // i] = i



kkk.reverse()

kkk = list(accumulate(kkk, func=max))

kkk.reverse()



print((*kkk[1:]))

from collections import Counter
from itertools import groupby


def bin_search(k, greater_count, smaller_sum):
    l = 0
    r = n + 1
    while l < r - 1:
        m = (l + r) // 2
        gc = greater_count[m]
        ss = smaller_sum[m]
        if gc + ss // m >= k:
            l = m
        else:
            r = m
    return l


n = int(eval(input()))
aaa = list(map(int, input().split()))
cnt = sorted(Counter(aaa).values())
# Precompute
greater_count = [0] * (n + 2)  # Number of types of Ai same or greater than i
smaller_sum = [n] * (n + 2)  # Number of Ai smaller than i
remain = greater_count[1] = len(cnt)
total = smaller_sum[1] = 0
cnt_grp = [(c, len(list(itr))) for c, itr in groupby(cnt)]
for (c, l), (c2, _) in zip(cnt_grp, cnt_grp[1:]):
    remain -= l
    total += c * l
    for i in range(c + 1, c2 + 1):
        greater_count[i] = remain
        smaller_sum[i] = total
# print(greater_count)
# print(smaller_sum)
# Query
buf = []
for k in range(1, len(cnt) + 1):
    buf.append(bin_search(k, greater_count, smaller_sum))
buf.extend([0] * (n - len(cnt)))
print((*buf))

from collections import Counter
from itertools import groupby, accumulate

n = int(eval(input()))
aaa = list(map(int, input().split()))
cnt = sorted(Counter(aaa).values())
remain = len(cnt)
total = 0
kkk = [0] * (n + 1)
p = 1
for c, itr in groupby(cnt):
    l = len(list(itr))
    for i in range(p, c + 1):
        kkk[remain + total // i] = i
    remain -= l
    total += c * l
    p = c + 1
for i in range(p, n + 1):
    kkk[remain + total // i] = i
kkk.reverse()
kkk = list(accumulate(kkk, func=max))
kkk.reverse()
print((*kkk[1:]))

-from itertools import groupby - - -def bin_search(k, greater_count, smaller_sum): -    l = 0 -    r = n + 1 -    while l < r - 1: -        m = (l + r) // 2 -        gc = greater_count[m] -        ss = smaller_sum[m] -        if gc + ss // m >= k: -            l = m -        else: -            r = m -    return l - +from itertools import groupby, accumulate -# Precompute -greater_count = [0] * (n + 2)  # Number of types of Ai same or greater than i -smaller_sum = [n] * (n + 2)  # Number of Ai smaller than i -remain = greater_count[1] = len(cnt) -total = smaller_sum[1] = 0 -cnt_grp = [(c, len(list(itr))) for c, itr in groupby(cnt)] -for (c, l), (c2, _) in zip(cnt_grp, cnt_grp[1:]): +remain = len(cnt) +total = 0 +kkk = [0] * (n + 1) +p = 1 +for c, itr in groupby(cnt): +    l = len(list(itr)) +    for i in range(p, c + 1): +        kkk[remain + total // i] = i -    for i in range(c + 1, c2 + 1): -        greater_count[i] = remain -        smaller_sum[i] = total -# print(greater_count) -# print(smaller_sum) -# Query -buf = [] -for k in range(1, len(cnt) + 1): -    buf.append(bin_search(k, greater_count, smaller_sum)) -buf.extend([0] * (n - len(cnt))) -print((*buf)) +    p = c + 1 +for i in range(p, n + 1): +    kkk[remain + total // i] = i +kkk.reverse() +kkk = list(accumulate(kkk, func=max)) +kkk.reverse() +print((*kkk[1:]))