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
44
45
46
47
48
49
50
#include <bits/stdc++.h>                                                        
using namespace std;                                                            
vector <pair<int, int>> k;                                                      
int main() {                                                                    
                                                                                
    int a, sum = 0, y = 0;                                                      
    cin>>a;                                                                     
                                                                                
    for(int i = 0;i<a;i++){                                                     
        int x, b = 0; cin>>x;                                                   
        for(int j = 0;j<k.size();j++){                                          
            if(k[j].first==x){                                                  
                k[j].second++;                                                  
                b = 1;                                                          
                break;                                                          
            }                                                                   
        }                                                                       
        if(b == 0){                                                             
            k.push_back({x, 1});                                                
        }                                                                       
                                                                                
    }                                                                           
    /*                                                                          
    for(int i = 0;i<a;i++){                                                     
        cout<<k[i].first<<" "<<k[i].second<<" ";                                
    }                                                                           
    */                                                                          
    for(int i = 1;i<=a;i++){                                                    
        sum = 0;                                                                
        if(y == 1){                                                             
            cout<<0<<' ';                                                       
        }                                                                       
        else{                                                                   
        for(int j = 0;j<=k.size();j++){                                         
            int d = k[j].second/i;                                              
            sum += d*i;                                                         
        }                                                                       
        if(sum == 0){                                                           
            y = 1;                                                              
        }                                                                       
        cout<<sum<<" ";                                                         
        }                                                                       
    }                                                                           
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
    return 0;                                                                   
}