N, *A = $<.read.split.map(&:to_i)

h = Hash.new(0)
A.each{|a|
	h[a] += 1
}
B = h.values.sort

p *(1..N).map{|k|
	b = B.dup
	next 0 if b.size < k
	(b.size-k-1).downto(0){|l|
		b[(-k..-1).min_by{|i| b[i] }] += b[l]
	}
	b[-k,k].min
}
