#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
using namespace std;
#define prev prev228
#define all(x) (x).begin(), (x).end()
int n;
int a[500000];
int cnt[500000];
int amount[500000];
pair<int, int> amounts[500000];
int amountssize;
pair<int, int> v[2][500000];
int vsize[2];

void solve(int k)
{
    set<pair<int, int>, greater<pair<int, int> > > s;
    for (int i = 0; i < n; i++) if (cnt[i]) s.insert({cnt[i], i});
    int c = 0;
    while (1)
    {
        if (s.size() < k)
        {
            cout << c << " ";
            return;
        }
        vector<pair<int, int> > v;
        for (int i = 0; i < k; i++)
        {
            auto it = s.begin();
            v.push_back(*it);
            s.erase(s.begin());
        }
        for (int i = 0; i < v.size(); i++)
        {
            if (v[i].first > 1)
                s.insert({v[i].first - 1, v[i].second});
        }
        c++;
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    int k = 0;
    for (int i = 1; k < n; i++)
    {
        for (int j = 0; j < i; j++)
        {
            a[k] = i;
            k++;
        }
    }
    //for (int i = 0; i < n; i++) cout << a[i] << " ";
    //cout << endl;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) a[i]--, cnt[a[i]]++;
    n++;
    sort(cnt, cnt + n);
    reverse(cnt, cnt + n);
    for (int i = 0; i < n; i++) amount[cnt[i]]++;
    for (int i = 1; i < n; i++) if (amount[i]) amounts[amountssize] = {i, amount[i]}, amountssize++;
    reverse(amounts, amounts + amountssize);
    n--;
    cout << n << " ";
    for (int k = 2; k <= n; k++)
    {
        for (int i = 0; i < amountssize; i++) v[0][i] = amounts[i];
        vsize[0] = amountssize;
        int res = 0;
        for (int op = 0; ; op ^= 1)
        {
            //cout << vsize[op] << " ";
            //cout << endl;
            vsize[1^op] = 0;
            int c = 0;
            for (int i = 0; i < vsize[op]; i++)
            {
                c += v[op][i].second;
                if (c >= k)
                {
                    int si = 0;
                    for (int j = 0; j < i; j++)
                    {
                        si += v[op][j].second;
                        v[1^op][vsize[1^op]] = {v[op][j].first - 1, v[op][j].second}, vsize[1^op]++;
                    }
                    if (c != k)
                    {
                        v[1^op][vsize[1^op]] = {v[op][i].first, v[op][i].second - k + si}, vsize[1^op]++;
                        if (vsize[1^op] > 1 && v[1^op][vsize[1^op] - 1].first == v[1^op][vsize[1^op] - 2].first)
                        {
                            v[1^op][vsize[1^op] - 2].second += v[1^op][vsize[1^op] - 1].second;
                            vsize[1^op]--;
                        }
                        v[1^op][vsize[1^op]] = {v[op][i].first - 1, k - si}, vsize[1^op]++;
                    }
                    else
                    {
                        v[1^op][vsize[1^op]] = {v[op][i].first - 1, v[op][i].second}, vsize[1^op]++;
                    }
                    for (int j = i + 1; j < vsize[op]; j++)
                    {
                        v[1^op][vsize[1^op]] = v[op][j], vsize[1^op]++;
                        if (vsize[1^op] > 1 && v[1^op][vsize[1^op] - 1].first == v[1^op][vsize[1^op] - 2].first)
                        {
                            v[1^op][vsize[1^op] - 2].second += v[1^op][vsize[1^op] - 1].second;
                            vsize[1^op]--;
                        }
                    }
                    if (vsize[1^op] && v[1^op][vsize[1^op] - 1].first == 0) vsize[1^op]--;
                    //v = g;
                    res++;
                    break;
                }
            }
            if (c < k)
            {
                break;
            }
        }
        cout << res << " ";
    }
}


Measured memory_bytes: 11520