Takahashi has N cards. The i-th of these cards has an integer A_i written on it.
Takahashi will choose an integer K, and then repeat the following operation some number of times:
 - Choose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)
For each K = 1,2, \ldots, N, find the maximum number of times Takahashi can do the operation.

-----Constraints-----
 -  1 \le N \le 3 \times 10^5 
 -  1 \le A_i \le N 
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
A_1 A_2 \ldots A_N

-----Output-----
Print N integers.
The t-th (1 \le t \le N) of them should be the answer for the case K=t.

-----Sample Input-----
3
2 1 2

-----Sample Output-----
3
1
0

For K = 1, we can do the operation as follows:
 - Choose the first card to eat.
 - Choose the second card to eat.
 - Choose the third card to eat.
For K = 2, we can do the operation as follows:
 - Choose the first and second cards to eat.
For K = 3, we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.

Difficulty: interview

Starter code:

Solutions:
N = int(input())
A = list(map(int,input().split()))
from collections import Counter
from bisect import bisect
vs = list(Counter(A).values())
vs.sort()
cums = [0]
for v in vs:
    cums.append(cums[-1] + v)

def is_ok(k,m):
    j = bisect(vs,m)
    z = cums[j] + m*(len(vs)-j)
    return z >= m*k

ans = []
for k in range(1,N+1):
    if k > len(vs):
        ans.append(0)
    else:
        ok = 0
        ng = N//k + 1
        while ng-ok > 1:
            m = (ok+ng)//2
            if is_ok(k,m):
                ok = m
            else:
                ng = m
        ans.append(ok)

print(*ans, sep='\n')

from collections import Counter
import bisect
N=int(input())
A=list(map(int,input().split()))
C=list(Counter(A).values())
C.sort()
L=len(C)

# Cのうちx以上のものの個数D[x]を計算(x=0,...,N)
D=[L-bisect.bisect_left(C,x) for x in range(N+1)]
S=[0]
for n in range(1,N+1):
    S.append(S[-1]+D[n])

# T[x]=S[x]/x(x=1,...,N)としてKをbisect_rightで挿入した時のindexが答え
T=[x/S[x] for x in range(1,N+1)]
for K in range(1,N+1):
    print(bisect.bisect_right(T,1/K))

from collections import Counter
from bisect import bisect_left
from itertools import accumulate

# https://betrue12.hateblo.jp/entry/2019/10/20/001106

N = int(input())
A = list(map(int, input().split()))
a = list(Counter(A).values())
a.sort()
b = list(accumulate(a))
length = len(a)

for i in range(1, N + 1):
    if i == 1:
        print(b[-1])
    elif len(a) < i:
        print(0)
    else:
        n = b[-1] // i
        for j in reversed(range(1, n + 1)):
            t = bisect_left(a, j)
            if j * i <= b[t - 1] + (length - t) * j:
                print(j)
                break

from collections import Counter
from itertools import accumulate
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
D = [0]*(n+1)
for v in C.values():
  D[v] += 1
E = tuple(accumulate(k*d for k, d in enumerate(D)))
D = tuple(accumulate(D))
F = [0]*(n+1)
for x in range(1, n+1):
  temp = (E[x] + x*(D[n]-D[x])) // x
  F[x] = temp
for k in range(1, n+1):
  ok = 0
  ng = n+1
  while ng-ok > 1:
    mid = (ok+ng)//2
    if k <= F[mid]:
      ok = mid
    else:
      ng = mid
  print(ok)

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
d = Counter(c.values())

dx = [0 for _ in range(n+1)]
for i in range(1, n+1):
	dx[i] = dx[i-1] + i*d[i]

xdx = [0 for _ in range(n+2)]
xdx[n] = d[n]
for i in range(n-1, 0, -1):
	xdx[i] = xdx[i+1] + d[i]

res = [0] + [(dx[i] + i*xdx[i+1]) // i for i in range(1, n+1)]
ans = [0 for _ in range(n)]
cur = n
for i in range(n):
	while cur > 0 and res[cur] < i+1:
		cur -= 1
	if cur > 0:
		ans[i] = cur
print(*ans, sep="\n")

N = int(input())
A = list(map(int, input().split()))
C = [0]*N
for a in A:
    C[a - 1] += 1
D = [0]*(N + 1)
for c in C:
    D[c] += 1

Dk_accum = [0]*(N + 1)
for i in range(1, N + 1):
    Dk_accum[i] = Dk_accum[i - 1] + i*D[i]
    
D_sum = sum(D)
D_accum = [0]*(N + 2)
D_accum[0] = D_sum
for i in range(1, N + 1):
    D_accum[i] = D_accum[i - 1] - D[i - 1]
    
F = [0]*(N + 1)
for i in range(1, N + 1):
    F[i] = (Dk_accum[i]//i + D_accum[i + 1])

i = N
for K in range(1, N + 1):
    while i > 0 and K > F[i]:
        i -= 1
    print(i)


# coding: utf-8
# Your code here!
def f(m,k):#最初のm個, kずつ
    if m == 0: return 0
    if m < k: return 0
#    if (m,k) in memo:
#        return memo[(m,k)]
    z = 0
    if acc[m]//k >= c[m]:
        return acc[m]//k
    else:
        return f(m-1,k-1)


import sys
#sys.setrecursionlimit(10**6)
readline = sys.stdin.readline 

from itertools import accumulate

n = int(input())
a = [int(i) for i in readline().split()]

res = [0]*(n+1)
for i in a: res[i] += 1

c = [0]
for i in res:
    if i > 0: c.append(i)
c.sort()#reverse=True)

l = len(c)-1
#print(c)
acc = list(accumulate(c))

#print(acc,c)
res = [n]+[acc[m]//c[m] for m in range(1,l+1)]


#print(l,res)


m = l
for k in range(1,n+1):
    k -= l-m
    if res[m] >= k:
        print((acc[m]//k))
    else:
#        print(k,m)
        while res[m] < k:
            m -= 1
            k -= 1
        print((acc[m]//(k)))







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

N = int(input())
A = list(map(int, input().split()))

C = sorted(list(Counter(A).values()), reverse=True)
L = len(C)
B = []

num = C[0]
for i, c in enumerate(C):
    for _ in range(num-c):
        B.append(i)
    num = c
for _ in range(num):
    B.append(L)

ans = [N]
for n in range(2, N+1):
    if n > L:
        ans.append(0)
        continue
    count = 0
    stack = []
    for b in B:
        tmp = b
        while stack:
            if tmp >= n:
                last = stack.pop()
                tmp = tmp + last - n
                count += 1
            else:
                break
        count += tmp//n
        stack.append(tmp%n)
    ans.append(count)

print(*ans, sep='\n')

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = list(Counter(a).values())
c.sort()

ans = n
cnt = 0
for i in range(n):
    m = i + 1 - cnt
    while c and c[-1] > ans // m:
        ans -= c.pop()
        cnt += 1
        m -= 1
    print(ans // m)

import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

# 解説AC
# https://twitter.com/maspy_stars/status/1185552225474498560
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

C = list(np.bincount(A).tolist())
C.sort()
deleted = 0
S = N


def solve(k):
    nonlocal S, deleted

    k -= deleted
    while k > 0 and C[-1] > S // k:
        S -= C.pop()
        deleted += 1
        k -= 1
    if k > 0:
        return S // k
    return 0


for k in range(1, N + 1):
    print((solve(k)))


N = int(input())
 
A = list(map(int,input().split()))
 
dic = {}
 
for a in A:
 
    if a not in dic:
        dic[a] = 1
    else:
        dic[a] += 1
 
B = []
for i in dic:
    B.append(dic[i])
 
B.sort()
 
B_sub = B.copy()
 
for i in range(len(B)-1):
    B_sub[i+1] += B_sub[i] 
 
aind = N + 1
nind = len(B) - 1
 
#print (B,B_sub)
 
for i in range(N):
 
    i += 1
 
    while True:
 
        while nind > 0 and B[nind] > aind - 1:
 
          nind -= 1
 
        if i > len(B):
            print (0)
            break
 
        elif ((len(B) - 1) - nind ) * (aind-1) + B_sub[nind] >= (aind - 1) * i:
            print (aind - 1)
            break
 
        aind -= 1

import collections
import numpy as np

# リストarrからx個の同じ長さの列を取り出す時の最大の長さ
# 発想: x個取り出す時、ある文字をx個より多く取り出して列に含むことはない
#       一方ある文字をその文字がある数よりも取り出して使うこともできない
#       つまり、min(arr.count(a), x)で、x個の同じ長さの列に使えるaの数がわかる
#       さらに、sum(min(arr.count(a),x))で、x個の同じ長さの列に使える文字の数がわかる
#       よって、sum(min(arr.count(a),x))//xで、x個の同じ長さの列の長さがわかる
#       発展的に、longest(arr,x)までの計算状況からlongest(arr,x+1)が計算できる
# def longest(arr, x):    # legacy
#     return sum(min(arr.count(a), x) for a in arr) // x


n = int(input())
a = list(map(int, input().split()))

counter = collections.Counter(a)        #O(n)
nums = list(counter.values())           #O(n)
num_counter = collections.Counter(nums) #O(n)
lastest_add = np.count_nonzero(nums)    #O(n)
building, longests = [0], [0]
for i in range(1, n+1):                 #O(n)
    appended = building[-1] + lastest_add   #O(1)
    building.append(appended)               #O(1)
    longests.append(appended // i)          #O(1)
    lastest_add -= num_counter[i]           #O(1)


lastest_longest = 0
k_most = []
for i, x in enumerate(reversed(longests)):
    while x > lastest_longest:
        lastest_longest += 1
        k_most.append(n-i)

k_most.extend([0]*(n-len(k_most)))      # zero padding

for longests_num in k_most:
    print(longests_num)

# print('----------------')
# for k in range(1, n+1):
#     maxindexes = list(i for i, x in enumerate(longests) if x >= k)
#     if maxindexes:
#         print(maxindexes[-1])
#     else:
#         print(0)


import bisect

n = int(input())
A = list(map(int, input().split()))
counts = [0]*(n)
for a in A:
    counts[a-1] += 1
counts.sort()

cumsum = []
num = 0
for count in counts:
    num += count
    cumsum.append(num)

answers = [0]*(n)
for i in range(1, n+1):
    idx = bisect.bisect_right(counts, i)
    left = cumsum[idx-1]
    right = (n-idx)*i
    K = (right+left)//i
    answers[K-1] = i

now = 0
for i in range(n-1, -1, -1):
    if answers[i] == 0:
        answers[i] = now
    now = answers[i]

for ans in answers:
    print(ans)

def main():
    N = int(input())
    A = list(map(int, input().split()))
    C = [0] * (N+1)
    Cnt_A = [0] * (N+1)
    for a in A:
        Cnt_A[a] += 1
        cnt = Cnt_A[a]
        C[cnt] += 1
    cum_C = []
    cu = 0
    for c in C:
        cu += c
        cum_C.append(cu)
    Ans = []
    for k in range(1, N+1):
        # K = k のとき、 n 組以上作れる <=> 使えるカードが nk 枚以上
        # n 組以上作れる <=> 同じカードは n 枚以下
        # 同じカードは n 枚以下で全体として nk 枚以上用意できるか？
        ok, ng = 0, N//k+1
        while ok + 1 < ng:
            n = ok+ng>>1
            if cum_C[n] >= n*k:
                ok = n
            else:
                ng = n
        Ans.append(ok)
    print(("\n".join(map(str, Ans))))

main()


n = int(input())
arr = list(map(int,input().split()))

from collections import Counter
c = Counter(arr)
c = list(c.values())
c.sort()
s = n

sol = []
removed = 0
for k in range(1,n+1):
    rest = k - removed
    while c and c[-1] > s//rest:
        s -= c[-1]
        c.pop()
        rest -= 1
        removed += 1
    sol.append(s//rest)

print("\n".join(map(str,sol)))

N = int(input())
A = list(map(int, input().split()))

C = [0] * N
D = [0] * (N + 1)
for a in A:
    C[a - 1] += 1
    D[C[a - 1]] += 1

S = [0] * (N + 1)
for i in range(N):
    S[i + 1] = S[i] + D[i + 1]

ans = N
for K in range(1, N + 1):
    while ans > 0 and S[ans] < K * ans:
        ans -= 1
    print(ans)

#!/usr/bin/env python3
import sys
import collections

def solve(N: int, A: "List[int]"):
    counter = sorted(list(collections.Counter(A).values()),reverse=True)
    c_index = 0
    k=0
    for i in range(1,N+1):
        k+=1
        if len(counter)<i:
            print((0))
            continue
        while counter[c_index]*k > N and c_index<len(counter)-1:
            N-=counter[c_index]
            c_index+=1
            k-=1
        print((N//k))
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

def __starting_point():
    main()

__starting_point()

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
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 main():
    n = I()
    c = sorted(collections.Counter(LI()).values(), reverse=True) + [0]
    ci = 0
    t = n
    r = [0]
    for i in range(n,0,-1):
        while c[ci] > i:
            ci += 1
        t -= ci
        r.append(t // i)

    rr = []
    r.reverse()
    ri = 0
    for i in range(n,0,-1):
        while r[ri] >= i:
            ri += 1
        rr.append(ri)

    rr.reverse()

    return JA(rr,"\n")


print(main())




from collections import Counter
N = int(input())
C = sorted(list(Counter(list(map(int, input().split()))).values()))

rest = N
removed = 0
for K in range(1, N + 1):
    d = K - removed
    while C and C[- 1] > rest//d:
        rest -= C[- 1]
        C.pop()
        removed += 1
        d -= 1
    print((rest//d))


# F - Distinct Numbers
from bisect import bisect_left

def isOK(c, k, N, L, cum_sum):
    i = bisect_left(L, c)
    s = c * (N - i) + cum_sum[i];
    return (s >= c * k)

N = int(input())
D = list(map(int, input().split()))
freq = [0] * N
for d in D:
    freq[d - 1] += 1
    
freq.sort()
cum_sum = [0] * (N + 1)
for i in range(N):
    cum_sum[i + 1] = cum_sum[i] + freq[i]
    
for k in range(1, N + 1):
    l = 0
    r = int(N / k) + 1
    while l + 1 < r:
        c = int((l + r) / 2)
        ok = isOK(c, k, N, freq, cum_sum)
        if ok:
            l = c
        else:
            r = c
    print(l)


import sys
input = sys.stdin.readline

from collections import Counter
from itertools import accumulate
from math import floor
from bisect import bisect_left


def main():
    n = int(input())
    a = list(map(int, input().split()))

    c = Counter(a)
    c = list(c.values())

    d = Counter(c)
    d_li = [0] * (n + 1)
    for k, v in list(d.items()):
        d_li[k] = v

    dk_acm = list(accumulate(d_li))

    kdk_acm = [0]
    for k, e in enumerate(d_li[1:], 1):
        kdk_acm.append(kdk_acm[-1] + k * e)

    def f(x):
        kdk_sm = kdk_acm[x]
        dk_sm = dk_acm[n] - dk_acm[x]

        return floor((kdk_sm + x * dk_sm) / x)

    fs = [float("inf")] + [f(x) for x in range(1, n + 1)]
    fs = fs[::-1]

    for k in range(1, n + 1):
        print((n - bisect_left(fs, k)))


def __starting_point():
    main()

__starting_point()

import sys 
import collections as cl


N=int(input())
A=list(map(int,sys.stdin.readline().split()))
c=cl.Counter(A)
NumberTupleList=c.most_common()
NumberList=[x[1] for x in NumberTupleList[::-1]]
LengthOfNumberList=len(NumberList)
FormulaList=[0 for i in range(N)]
flag=0
S=sum(NumberList)
for x in range(1,N+1):
    while flag<LengthOfNumberList and NumberList[flag]<=x:
        flag+=1
    if flag<LengthOfNumberList:
        FormulaList[x-1]=(sum(NumberList[:flag])+x*(LengthOfNumberList-flag))/x
    else:
        FormulaList[x-1]=S/x
pin=N-1
for K in range(1,N+1):
    while pin>=0 and K>FormulaList[pin]:
        pin-=1
    print((pin+1))



from bisect import bisect_left

N = int(input())
A = list(map(int, input().split()))

lst = [0] * (N + 1)
for a in A:
    lst[a - 1] += 1
lst.sort() #頻度列

s = [0] * (N + 1)
for i in range(N):
    s[i + 1] = s[i] + lst[i + 1]

# print (lst)
# print (s)

def check(x, k):
    i = bisect_left(lst, x) - 1
    total = x * (N - i) + s[i]
    return total >= x * k


for k in range(1, N + 1):
    l = 0 #OK
    r = N // k + 1 #NG
    while l + 1 < r:
        c = (l + r) // 2
        if check(c, k):
            l = c
        else:
            r = c
    print (l)


import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

# 解説AC
# https://img.atcoder.jp/abc143/editorial.pdf
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

A = np.array(A, dtype=int)
C = np.bincount(A, minlength=N + 2)
D = np.bincount(C, minlength=N + 2)

ld = (D * np.arange(len(D))).cumsum()
ud = D[::-1].cumsum()[::-1]

X = np.arange(1, N + 1, dtype=int)
# L[x]: x 回取れるときの最大の長さ k
L = np.zeros(N + 1, dtype=int)
L[X] = (ld[X] + X * ud[X + 1]) // X

i = len(L) - 1
for k in range(1, N + 1):
    while i > 0 and L[i] < k:
        i -= 1
    print(i)


from collections import Counter
N = int(input())
#C = sorted(list(Counter(map(int, input().split())).values()))
C = list(Counter(map(int, input().split())).values())
C.sort()

rest = N
removed = 0
for K in range(1, N + 1):
    d = K - removed
    while C and C[- 1] > rest//d:
        rest -= C[- 1]
        C.pop()
        removed += 1
        d -= 1
    print(rest//d)

import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

import bisect
from collections import Counter

n = ni()
a = na()

c = sorted(Counter(a).values())
cc = [0]
m = len(c)
for i in c:
    cc.append(cc[-1]+i)

def is_ok(k,arg):
    b = bisect.bisect_right(c,arg)
    p = cc[b] + (m-b)*arg
    return True if p >= arg*k else False

for k in range(1,n+1):
    if k > m:
        print((0))
        continue
    #にぶたん
    ok,ng = -1,n//k+1
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(k,mid):
            ok = mid
        else:
            ng = mid
    
    print(ok)


import sys
input = sys.stdin.readline
n=int(input())
a=[int(j) for j in input().split()]
from collections import Counter
c=Counter(a)
l=c.most_common()
ll=[]
for i,j in l:
    ll.append(j)
ll.sort()
s=sum(ll)
rem=0
for k in range(1,n+1):
    rest=k-rem
    while ll and ll[-1]>s//rest:
        s-=ll[-1]
        ll.pop()
        rem+=1
        rest-=1
    print((s//rest))






import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

from collections import Counter
from itertools import accumulate
import bisect

C=Counter(A)

LIST=sorted(C.values())
LEN=len(LIST)
SUM=[0]+list(accumulate(LIST))
MIN=0
MAX=SUM[-1]

for k in range(1,N+1):
    MIN=0
    while MIN!=MAX:
        mid=(MIN+MAX+1)//2
        x=bisect.bisect_right(LIST,mid)

        if SUM[x]+(LEN-x)*mid>=mid*k:
            MIN=mid
        else:
            MAX=mid-1

    print(MIN)


from bisect import bisect_left

N = int(input())
A = list(map(int, input().split()))

lst = [0] * (N + 1)
for a in A:
    lst[a - 1] += 1
lst.sort() #頻度列

s = [0] * (N + 1)
for i in range(N):
    s[i + 1] = s[i] + lst[i + 1]

# print (lst)
# print (s)

def check(x, k):
    i = bisect_left(lst, x) - 1
    total = x * (N - i) + s[i]
    return total >= x * k

ans = N
for k in range(1, N + 1):
    while True:
        if check(ans, k):
            break
        ans -= 1
    print (ans)


# -*- coding: utf-8 -*-
from collections import Counter
from itertools import accumulate

N = int(input())
A = list(map(int,input().split()))

B = list(Counter(A).values())

C = [0] * N 
for i in B:
    C[i-1] += 1

F = list(accumulate(C))

S = [0] * N
f = [0] * N
S[0] = f[0] = sum(C) 
for i in range(2, N+1):
    S[i-1] = (S[i-2] + C[i-1] + S[0] - F[i-1] ) 
    f[i-1] = S[i-1] / i

f.sort()
n = 0     
K = 1
    
while K != N+1:
    if K <= f[n]:
        print(N-n)
        K += 1
    else:
        n += 1
    if n == N:
        for i in range(N-K+1):
            print(0)
        K = N+1    

import itertools
import collections
N = int(input())
A = [int(_) for _ in input().split()]
c = sorted(collections.Counter(A).values())
acc = list(itertools.accumulate([0] + c))
n = len(acc) - 1
j = 0
for i in range(1, n + 1):
    r = 0
    while i - j > 0:
        if (i - j) * c[-1 - j] <= acc[-1 - j]:
            r = acc[-1 - j] // (i - j)
            break
        else:
            j += 1
    print(r)
for _ in range(N - n):
    print((0))


from collections import Counter
import bisect


def main():
    N = int(input())
    A = list(map(int, input().split()))
    count_list = list(Counter(A).values())
    count_list.sort()
    cumsum_count = [0] * len(count_list)
    cumsum_count[0] = count_list[0]
    for i in range(1, len(count_list)):
        cumsum_count[i] = cumsum_count[i - 1] + count_list[i]
    ans_list = [0] * N
    n_max = N
    for k in range(1, len(count_list) + 1):
        # 最大でも N // k 回まで。
        # 各カード n_max 枚まで使って k * n_max の長方形領域を全部埋め尽くせるかを調べる。
        # 埋め尽くせる最小の n_max が答え。
        n_max = min(n_max, N // k)
        s = 0
        while True:
            # n_max 枚以上あるカードは n_max 枚固定
            index = bisect.bisect_left(count_list, n_max)
            s = n_max * (len(count_list) - index)
            # それ未満のカードはそのまま全部使う
            if index > 0:
                s += cumsum_count[index - 1]
            if s >= k * n_max or n_max == 0:
                break
            n_max -= 1
        ans_list[k - 1] = n_max
    for ans in ans_list:
        print(ans)


def __starting_point():
    main()
__starting_point()

n = int(input())
A = list(map(int,input().split()))
B = [0]*(n+1)
C = [0]*(n+1)
for a in A:
    B[a] += 1
    C[B[a]] += 1

X = [0]
for i in range(1,n+1):
    X.append(X[i-1] + C[i])
for j in range(1,n+1):
    X[j] = X[j] // j

ind = n
k = 1
while k<=n:
    if ind<0:
        for _ in range(n-k+1):
            print(0)
        break
    if k<=X[ind]:
        print(ind)
        k += 1
    else:
        ind -= 1

from itertools import accumulate

N, *A = map(int, open(0).read().split())

C = [0] * (N + 1)
D = [0] * (N + 1)
for a in A:
    C[a] += 1
    D[C[a]] += 1

T = [0] + [s // i for i, s in enumerate(accumulate(D[1:]), 1)]

ans = []
x = N
for k in range(1, N + 1):
    while 0 < x and T[x] < k:
        x -= 1
    ans.append(x)

print("\n".join(map(str, ans)))

from collections import Counter
from bisect import bisect_left
from itertools import accumulate

N = int(input())
A = list(map(int, input().split()))
a = list(Counter(A).values())
a.sort()
b = list(accumulate(a + [0]))
s = sum(a)
length = len(a)

for i in range(1, N + 1):
    if i == 1:
        print(s)
    elif len(a) < i:
        print(0)
    else:
        n = s // i
        for j in reversed(range(1, n + 1)):
            t = bisect_left(a, j)
            if j * i <= b[t - 1] + (length - t) * j:
                print(j)
                break

def main():
    N = int(input())
    A = list(map(int, input().split()))

    # C[x]: 書かれている整数がxであるカードの枚数
    C = [0] * (N + 1)
    D = [0] * (N + 1)
    for a in A:
        C[a] += 1
        D[C[a]] += 1

    # AからK(1<=K<=N)枚ずつカードを抜いてったときに、
    # x回以上抜くことができるか判定する。
    # 抜くことができると判定されたxの最大値が答えになる。

    # 例えば、A = [1 1 1 1 1 2 2 3] とする。
    # -> C = [5 2 1 0 0 0 0 0]
    # ここから2枚ずつカードを抜ける回数を考えるとき、
    # 「3回抜く」とすると、数字の1は、どうやっても2個は絶対余る
    # そこで、絶対余る部分を捨ててCを作り直す(=Eとする)と、
    # E = [3 2 1 0 0 0 0 0]
    # ここから2枚ずつ3回抜けるか判定するなら、
    # sum(E) >= 2 * 3 = 6
    # であるか見ればよい。今回の場合ちょうど6なので、2枚ずつ3回は抜ける。
    
    # 3枚ずつ2回ぬけるか調べる場合、
    # E = [2 2 1] となり、sum(E) = 5 < 3 * 2 = 6 なので、抜けないことが分かる

    # よって、
    # sum(min(C[i], x)) >= K * x であれば抜くことができる
    # S(x) = sum(min(C[i], x)) とすると、
    # S(x) = S(x-1) + [Cの中でC[i] >= x であるものの個数]
    # となることから、Cの中でC[i] >= x であるものの個数 = D(x) とすると、
    # S(x) = sum_(1~x) D(i) となる。
    # つまり、S(x)は、D(x) を最初に全部計算しておいて、累積和をとることで高速に計算できる。

    # S(x) >= K * x となるxの最大値を、kを1からNまで動かして見つければよい。
    # ここで、xを左辺にもっていって、
    # S(x) / x >= Kとなるxの最大値を見つけるようにする。
    # また、S(x) / x = f(x) とおく。

    # 最大値を見つけるために2分探索してもいいが、
    # Kが増えると、答えは以前の値以下になるはずなので、
    # K+1のとき、Kでの答えの位置から0へと探索していけば、O(N)で答えが見つかる
    S = [0] * (N + 1)
    f = [0] * (N + 1)
    for x in range(1, N+1):
        S[x] = S[x-1] + D[x]
        f[x] = S[x] // x

    ans = []
    prev_ans = N
    for K in range(1, N+1):
        a = prev_ans
        while True:
            if f[a] >= K or a == 0:
                break
            a -= 1
        ans.append(a)
        prev_ans = a

    print(*ans, sep='\n')

def __starting_point():
    main()
__starting_point()

def main():
    from sys import stdin
    input = stdin.readline
    from collections import Counter as ct
    from bisect import bisect_left as bl

    n = int(input())
    max_a = sorted(ct(list(map(int, input().split()))).values())
    now_a = [i for i in max_a]
    m = len(max_a)
    cnt = m
    ans = 0
    ans_list = [0]*(n-m)

    for use in range(m, 1, -1):
        rest = ans
        nex = now_a[0]
        while rest:
            val = nex
            start = bl(now_a, val+1)
            nex += 1
            q = max(-1, start-1-rest, bl(max_a, now_a[start-1]+1)-1)
            for i in range(start-1, q, -1):
                now_a[i] += 1
            if now_a[start-1] == 1:
                cnt += start-1-q
            rest -= start-1-q
            if start != m:
                nex = now_a[start]
        while cnt >= use:
            ans += 1
            rest = use
            nex = now_a[-1]
            end = m
            while rest:
                val = nex
                start = bl(now_a, val)
                if start != 0:
                    nex = now_a[start-1]
                end = min(end, bl(now_a, val+1), start+rest)
                for i in range(start, end):
                    now_a[i] -= 1
                if now_a[start] == 0:
                    cnt -= end-start
                rest -= end-start
                end = start
        ans_list.append(ans)
    print(n)
    for i in ans_list[::-1]:
        print(i)


main()

N = int(input())
A = list(map(int,input().split()))
C = [0] * (N + 1)
for a in A:
    C[a] += 1
D = [0] * (N + 1)
for c in C:
    D[c] += 1
P = [0] * (N + 1)
Q = [0] * (N + 1)
for i in range(1, N+1):
    P[i] = P[i-1] + i * D[i]
    Q[i] = Q[i-1] + D[i]
F = [0] * (N + 1)
for i in range(1, N+1):
    F[i] = int((P[i] + i * (Q[N] - Q[i])) / i)
index = N
for i in range(1, N+1):
    while True:
        if index == 0:
            print(0)
            break
        if F[index] >= i:
            print(index)
            break
        else:
            index -= 1

from collections import defaultdict
from bisect import bisect
N = int(input())
A = list(map(int,input().split()))

d = defaultdict(lambda:0)

for i in range(N):
    d[A[i]] += 1

C = [0]*(N+1)

for i in d:
    C[d[i]] += 1

C1 = [0]*(N+1)
C2 = [0]*(N+1)

for i in range(N):
    C1[i+1] = C1[i] + (i+1)*C[i+1]
    C2[i+1] = C2[i] + C[i+1]

l = [0]*N
for n in range(N):
    l[n] = C1[n+1]//(n+1)+C2[N]-C2[n+1]
    l[n] *= -1


for i in range(N):
    print(bisect(l,-(i+1)))


N = int(input())

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

dic = {}

for a in A:

    if a not in dic:
        dic[a] = 1
    else:
        dic[a] += 1

B = []
for i in dic:
    B.append(dic[i])

B.sort()

B_sub = B.copy()

for i in range(len(B)-1):
    B_sub[i+1] += B_sub[i] 

aind = N + 1
nind = len(B) - 1

#print (B,B_sub)

for i in range(N):

    i += 1

    while True:

        while nind > 0 and B[nind] > aind - 1:

          nind -= 1

        if i > len(B):
            print((0))
            break

        elif ((len(B) - 1) - nind ) * (aind-1) + B_sub[nind] >= (aind - 1) * i:
            print((aind - 1))
            break

        aind -= 1



N = int(input())
A = list(map(int, input().split()))

num = [0 for _ in range(N)]
for a in A:
    num[a-1] += 1
num.sort()
cum = [0 for _ in range(N)]
cum[0] = num[0]
for i in range(1, N):
    cum[i] = cum[i-1] + num[i]

index = N - 1
ans = N
for k in range(1, N+1):
    while ans > 0:
        tmp_index = index
        while tmp_index >= 0 and num[tmp_index] > ans:
            tmp_index -= 1
        decided = N - tmp_index - 1
        rest_total = 0 if tmp_index < 0 else cum[tmp_index]
        if rest_total >= ans * (k - decided):
            index = tmp_index
            break
        ans -= 1
    print(ans)

import sys
from collections import Counter

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def main():
    n = int(input())
    aa = list(map(int, input().split()))
    aa = list(Counter(aa).values())
    aa.sort()
    cs = [0]
    s = 0
    for a in aa:
        s += a
        cs += [s]
    # print(aa)
    # print(cs)
    ans = n + 1
    i = len(aa)
    for k in range(1, n + 1):
        while 1:
            while i > 0 and aa[i - 1] >= ans:
                i -= 1
            s = cs[i] + ans * (len(aa) - i)
            if s >= ans * k:
                break
            else:
                ans -= 1
        print(ans)

main()


N=int(input())
A=list(map(int,input().split()))

c = [0] * (N + 1)
Dx = [0] * (N + 1)
for a in A:
    c[a] += 1 #cは、aという数が出た回数を記録
    Dx[c[a]]+=1
    #Dxは、その回数のところに種類を記録。賢い。

Sx=[0]#初項は0
for j in range(1,N+1):
    Sx.append(Sx[j-1]+Dx[j])
#解法2を真似してみる。
for h in range(1,N+1):
    Sx[h]=Sx[h]/h

x=N
k=1
while k<N+1:
    if x<0:
        for _ in range(N-k+1):
            print((0))
        return
    if k<=Sx[x]:
        print(x)
        k+=1
    else:
        x-=1


from collections import Counter

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

cntA = Counter(As)
cntCntA = Counter(list(cntA.values()))

accDs = [cntCntA[0]]
for i in range(1, N+1):
    accDs.append(accDs[-1] + cntCntA[i])

accKDs = [0]
for i in range(1, N+1):
    accKDs.append(accKDs[-1] + i*cntCntA[i])

fXs = [0]
for X in range(1, N+1):
    fXs.append((accKDs[X] + X*(accDs[N]-accDs[X])) // X)

anss = [0] * (N+1)
for X, fX in enumerate(fXs):
    anss[fX] = X

for i in reversed(list(range(N))):
    if anss[i] == 0:
        anss[i] = anss[i+1]

print(('\n'.join(map(str, anss[1:]))))


from bisect import bisect_left

N = int(input())
A = list(map(int, input().split()))

lst = [0] * (N)
for a in A:
    lst[a - 1] += 1
lst.sort() #頻度列

s = [0] * (N + 1)
for i in range(N):
    s[i + 1] = s[i] + lst[i]

# print (lst)
# print (s)

# def check(x, k):
#     i = bisect_left(lst, x) - 1
#     total = x * (N - i) + s[i]
#     return total >= x * k


ans = N
i = N
for k in range(1, N + 1):
    while True:
        while  i >= 1 and lst[i - 1] >= ans:
            i -= 1
        total = ans * (N - i) + s[i]
        if total >= ans * k:
            break
        ans -= 1
    # print ('i =', i)
    print (ans)


from collections import Counter
N = int(input())
C = sorted(list(Counter(list(map(int, input().split()))).values()))

rest = N
removed = 0
for K in range(1, N + 1):
    d = K - removed
    while C and C[- 1] > rest//d:
        rest -= C[- 1]
        C.pop()
        removed += 1
        d -= 1
    print((rest//d))