Advertisement
Guest User

Untitled

a guest
Jul 26th, 2018
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int maxn = 110;
  6.  
  7. int n, m, ans;
  8. int cnt[maxn];
  9.  
  10. int main() {
  11. cin >> n >> m;
  12.  
  13. for(int i = 0, x; i < m; i++) {
  14. cin >> x;
  15. cnt[x]++;
  16. }
  17.  
  18. for(int i = 1; i <= m; i++) {
  19. int sum = 0;
  20.  
  21. for(int j = 1; j < maxn; j++)
  22. sum += cnt[j] / i;
  23.  
  24. if(sum >= n)
  25. ans = i;
  26. }
  27.  
  28. cout << ans << endl;
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement