Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int maxn = 110;
- int n, m, ans;
- int cnt[maxn];
- int main() {
- cin >> n >> m;
- for(int i = 0, x; i < m; i++) {
- cin >> x;
- cnt[x]++;
- }
- for(int i = 1; i <= m; i++) {
- int sum = 0;
- for(int j = 1; j < maxn; j++)
- sum += cnt[j] / i;
- if(sum >= n)
- ans = i;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement