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 <iostream>
#include <vector>
#include <sstream>

int main() {
    int n;
    std::cin >> n;
    std::cin.ignore();

    std::vector<int> cities_dif;
    std::vector<int> cities_num;
    
    std::string line;
    std::getline(std::cin, line);
    std::istringstream iss(line);

    int num;
    bool wasnt;
    while (iss >> num) {
        wasnt = true;
        for (int i = 0; i < cities_dif.size(); i++) {
            if (num == cities_dif[i]) {
                cities_num[i]++;
                wasnt = false;
            }
        }
        if (wasnt) {
            cities_dif.push_back(num);
            cities_num.push_back(1);
        }
    }

    int given;
    for (int i = 0; i < n; i++) {
        given = n;
        for (int j = 0; j < cities_num.size(); j++) {
            given -= cities_num[j]%(i+1);
        }
        std::cout << given << " ";
    }

    return 0;
}