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
#include <iostream>
#include <map>

using namespace std;

const int N = 3e5 + 7;
int wyn[N];

int main() {
    map<int, int> znaczki;
    int n, x;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        znaczki[x]++;
    }

    for (auto it : znaczki) {
        int count = it.second;
        for (int i = 1; i <= count; i++) {
            wyn[i] += count - (count % i);
        }
    }

    for (int i = 1; i <= n; i++) {
        cout << wyn[i] << " ";
    }
    return 0;
}