1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>

using namespace std;
vector<int> tab;
vector<int> tab2;
queue<int> kol;
int odw[99999999];
int ile[99999999];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, a;
    cin>>n;
    for(int i = 0; i < n; i++){
        cin>>a;
        if(odw[a] != 1){
            odw[a]++;
            kol.push(a);
            tab2.push_back(a);
        }
        tab.push_back(a);
    }
    while(!kol.empty()){
        a = kol.front();
        for(int i = 0; i < n; i++){
            if(tab[i] == a){
                ile[a]++;
            }
        }
        kol.pop();
    }
    int suma = 0;
    cout<<n<<" ";
    for(int i = 1; i < n; i++){
        suma = 0;
        for(int j = 0; j < tab2.size(); j++){
            suma += (ile[tab2[j]]) / (i + 1); 
            //cout<<" = "<<(ile[tab2[j]]) / (i + 1)<<" = ";
        }
        cout<<suma*(i+1)<<" ";
    }
}