Natasha is planning an expedition to Mars for $$$n$$$ people. One of the important tasks is to provide food for each participant.The warehouse has $$$m$$$ daily food packages. Each package has some food type $$$a_i$$$.Each participant must eat exactly one food package each day. Due to extreme loads, each participant must eat the same food type throughout the expedition. Different participants may eat different (or the same) types of food.Formally, for each participant $$$j$$$ Natasha should select his food type $$$b_j$$$ and each day $$$j$$$-th participant will eat one food package of type $$$b_j$$$. The values $$$b_j$$$ for different participants may be different.What is the maximum possible number of days the expedition can last, following the requirements above?

The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 100$$$, $$$1 \le m \le 100$$$) — the number of the expedition participants and the number of the daily food packages available. The second line contains sequence of integers $$$a_1, a_2, \dots, a_m$$$ ($$$1 \le a_i \le 100$$$), where $$$a_i$$$ is the type of $$$i$$$-th food package.

Print the single integer — the number of days the expedition can last. If it is not possible to plan the expedition for even one day, print 0.

NoteIn the first example, Natasha can assign type $$$1$$$ food to the first participant, the same type $$$1$$$ to the second, type $$$5$$$ to the third and type $$$2$$$ to the fourth. In this case, the expedition can last for $$$2$$$ days, since each participant can get two food packages of his food type (there will be used $$$4$$$ packages of type $$$1$$$, two packages of type $$$2$$$ and two packages of type $$$5$$$).In the second example, there are $$$100$$$ participants and only $$$1$$$ food package. In this case, the expedition can't last even $$$1$$$ day.

#include<stdio.h>
using namespace std;
int a[105],b[105];
int main(){
    int n,m,i,j,max=0,ans;
    scanf("%d%d",&n,&m);
    if(n==m){
        printf("1");return 0;
    }
    if(n>m){
        printf("0");return 0;
    }
    for(i=1;i<=m;i++){
        scanf("%d",&a[i]);
        b[a[i]]++;
        if(a[i]>max)max=a[i];
    }
    for(i=1;i<=101;i++){
        ans=0;
        for(j=1;j<=max;j++){
        	ans=ans+b[j]/i;
		}
        if(ans<n){
        	printf("%d",i-1);return 0;
		}
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n,m;
int a[505];
vector<int> v;
bool comp(int a, int b){return (a>b);}
int main()
{
    cin>>m>>n;
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++){
        int input;
        cin>>input;
        a[input]++;
    }
    for(int i=0;i<500;i++) if(a[i]) v.push_back(a[i]);
    sort(v.begin(), v.end(), comp);
    int ans=0;
    int temp=0;
    for(int k=1;k<105;k++)
    {
        temp=0;
        for(int i=0;i<v.size();i++)
        {
            temp += v[i]/k;
        }
        if(temp >= m) ans = max(ans,k);
    }
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define fr first
#define sc second
int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0},dxx[8]={0,0,1,1,1,-1,-1,-1},dyy[8]={1,-1,0,1,-1,0,1,-1};
//914836017997511610
int cnt[105];
int main()
{ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int n,m,i,j,x;
cin>>n>>m;
if(n>m)
{cout<<0;return 0;}
for(i=1;i<=m;++i)
	{cin>>x;++cnt[x];}
sort(cnt,cnt+102,greater<int>());
//int ans=cnt[0]/n,val;
bool flag;int val=0;
for(i=m;i>0;--i)
{	 val=0;
	for(j=0;j<=100;++j)
	{
		if(cnt[j]==0)
			break;
		val+=cnt[j]/i;

		if(val>=n)
			break;
	}

	if(val>=n)
		break;

}

cout<<i;
return 0;
}

#include <stdio.h>
#include <string>
#include <iostream>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <deque>
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define all(a) a.begin(), a.end()
#define rt return
using namespace std;

const int max_size = 1e6, INF = 1e9 + 10, mod = 1e9 + 7;
const double eps = 1e-6;
int n ,m ;
map <int, int> have;
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	for(int i = 0; i < m ;i++){
		int a;
		cin >> a;
		have[a] += 1;
	}
	for(int i = 500; i > 0; i--){
		int k = 0;
		for(auto j = have.begin() ; j != have.end(); j++){
			pii now = *j;
			k += now.second / i;
		}
		if(k >= n){
		cout << i;
		rt 0;
		}
	}
	cout << 0;

	rt 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	int m;
	int ai;
	int l = 0;
	int r = 100;
	cin >> n;
	cin >> m;
	vector <int> arr(101);
	for (int i = 0; i < m; i++)
	{
		cin >> ai;
		arr.at(ai)++;
	}

	if (m < n)
	{
		cout << 0;
		return 0;
	}

	sort(arr.begin(), arr.end());

	int p;
	p = (l + r+1) / 2;
	while (l < r)
	{
		int y = 0;
		for (int i = 100; i >= 0; i--)
		{
			if (arr.at(i) < p)
			{
				break;
			}
			if (arr.at(i) >= p)
			{
				y = y + arr.at(i) / p;
			}
			if (y >= n)
			{
				l = p;
				break;
			}
		}
		if (l != p)
		{
			r = p-1;
		}
		p = (l + r+1) / 2;
	}
	cout << p;
	return 0;
}

#include<bits/stdc++.h>
#include<vector>
#include<map>
typedef long long int ll;
#define mp make_pair
#define ff first
#define ss second
#define sol(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
using namespace std;
int main()
{
    ll n,m;cin>>n>>m;
    ll a[m];
    map<ll,ll>m1;
    sol(i,0,m)
    {
        cin>>a[i];
        m1[a[i]]++;
    }
    vector<ll>v;
    if(m<n) cout<<0;
    else{
        sol(i,0,m1.size())
        {
            if(m1[i]!=0)
            v.push_back(m1[i]);
        }
        sort(v.rbegin(),v.rend());
        ll a=0;
        //sol(i,0,v.size()) cout<<v[i]<<endl;
        if(v.size()==1) cout<<m/n;
        else{
        for(ll i=v[0];i>0;i--)
        {
            a=0;
            //cout<<i<<endl;
            for(ll j=0;j<v.size();j++)
            {
                a+=v[j]/i;
            }
            if(a>=n)
            {
                cout<<i;
                return 0;
            }
        }
        cout<<0;
        }
    }
}

#include<bits/stdc++.h>

int n,m,x,t;
int a[111];

int main() {
	scanf("%d%d", &n, &m);
	memset(a,0,sizeof(a));
	for(int i=1;i<=m;i++) {
		scanf("%d", &x);
		a[x]++;
	}
	int ans = 0;
	for(int i=m;i>0;i--) {
		t = 0;
		for(int j=1;j<=100;j++)
            t += a[j]/i;
		if (t>=n) {
			ans=i; break;
		}
	}
	printf("%d\n", ans);

	return 0;
}

/*#include  <bits/stdc++.h>
using namespace std;
#define ll long long
int a[100000];

int main() {
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
			cin >> p[i].first;
	}
	for (int i = 0; i< n; i++) {
			cin >> p[i].second;
	}
	long double l = 0, r = 1e10, ans = 1e12;
	while (j < 600) {
		x = (r  +l) / 2;
	}
}*/
#include  <bits/stdc++.h>
using namespace std;
#define ll long long
int a[201];
int main() {
	int n, m, z, kol =0, ans = 0;
	cin >> n >> m;
	for (int i =0; i < m; i++) {
			cin >> z;
			a[z]++;
	}
	if (m < n) {
			cout << 0;
			return 0;
	}
	for (int i = 1; i <= 100; i++) {
			kol = 0;
			for(int j = 1; j <= 100; j++){
					kol += a[j] / i;
			}
			if(kol >= n)
				ans= max(ans, i);
	}
	cout << ans;
}

//Ye code tumhare baap ka hai....jo muh maar rhe ho
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define fix  cout<<std::fixed;
#define mk make__pair
#define IOS             ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
 int n,m,day,exp;
 cin>>n>>m;
 int count[101]={0};

 for(int i=0;i<m;i++)
 {
int a;cin>>a;
count[a]++;
 }
 for( day=m;day>=1;day--)
 {
  exp=0;
  for(int i=1;i<=100;i++)
  {
    exp+= count[i]/day;
  }
  if(exp>=n)
    {break;}
 }
 cout<<day;

}

#include <bits/stdc++.h>
using namespace std;

const int maxn = 111;
int n, m;
int a[maxn], vis[maxn];

int ok(int day) {
  int tot = 0;
  for(int i = 0; i < 101; i++) {
    if(vis[i] >= day) tot += (int)vis[i] / day;
  }
  return tot >= n;
}

signed main() {
  // freopen("in", "r", stdin);
  while(~scanf("%d%d",&n,&m)) {
    int lo = 0, hi = 10000;
    memset(vis, 0, sizeof(vis));
    for(int i = 1; i <= m; i++) {
      scanf("%d", &a[i]);
      hi = max(hi, a[i]);
      vis[a[i]]++;
    }
    if(n > m) {
      printf("0\n");
      continue;
    }
    int ret = 0;
    while(lo <= hi) {
      int mid = (lo + hi) >> 1;
      if(ok(mid)) {
        ret = mid;
        lo = mid + 1;
      }
      else hi = mid - 1;
    }
    printf("%d\n", ret);
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[110];
int dp[110][110];
map<int, int>mp;

bool cmp(int p, int q) {
    return p > q;
}

int main() {
    int n, m;
    while(scanf("%d%d", &n, &m) == 2) {
        memset(a, 0, sizeof(a));
        memset(dp, 0, sizeof(dp));
        int u;
        int b = -1;
        for(int i = 1; i <= m; i++) {
            cin >> u;
            a[u]++;
            b = max(b, u);
        }
        sort(a + 1, a + 110, cmp);
        int ans = 0, l = 0;//cout << "****" << a[1] << endl;
        for(int i = 0; i <= b; i++) {if(a[i])l++;}
        for(int i = 1; i <= n; i++) {dp[1][i] = a[1]/i;}
        for(int i = 1; i <= l; i++) {dp[i][1] = a[1];}
        for(int i = 2; i <= l; i++) {
            for(int j = 1; j <= n; j++) {
                //dp[i][j] = 0;
                for(int k = 0; k < j; k++){

                    dp[i][j] = max(dp[i][j], min(dp[i-1][k],a[i]/(j-k)));
                    //printf("i=%d   j=%d   k=%d   ij%d   i-1,k%d   %d\n", i,j,k,dp[i][j], dp[i-1][k], a[i]/(j-k));
                }
            }
        }
        /*for(int i = 1; i <= l; i++) {
            for(int j = 1; j <= n; j++) {
                printf("%d ", dp[i][j]);
            }cout << endl;
        }//cout << endl;*/
        int Max = 0;
        for(int i = 1; i <= l; i++) {
            Max = max(dp[i][n],Max);
        }
        cout << Max << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int M = 1e2 + 7;
int cnt[M];

int main()
{
    ios_base::sync_with_stdio(false),cin.tie(0);

    int n,k;
    cin >> n >> k;

    for(int i = 0; i < k; i++){
        int x;
        cin >> x;
        cnt[x]++;
    }
    int loop = 100;
    int lo = 1, hi = 200, mid;

    while(lo < hi){
        mid = (lo + hi) / 2;
        int s = 0;
        for(int i = 0; i <= 100; i++){
            s += cnt[i] / mid;
        }
        if(s < n)
            hi = mid;
        else
            lo = mid + 1;
        //if(hi <= lo) break;
        //if(mid == 0) break;
        //cout << lo << ' ' << hi << endl;
    }

    cout << lo - 1 << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    int sz = 100 + 10;
    vector <int> v(sz);
    for (int i = 0; i < m; i++){
        int x;
        cin >> x;
        v[x]++;
    }
    sort(v.rbegin(), v.rend());

    int maxDays = (int) (m/n);
    while (maxDays > 0){
        int ppl = n;
        for (int i = 0; i < sz; i++){
            if (v[i] >= maxDays){
                int take = (int) v[i]/maxDays;
                ppl -= take;
            }
            if (ppl <= 0){
                cout << maxDays;
                return 0;
            }
        }
        maxDays--;
    }
    cout << 0 << endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a[m];
    int ct[101]={0};
    for(int i=0;i<m;i++)
    cin>>a[i];
    for(int i=0;i<m;i++)
    {
        ct[a[i]]++;
    }
    int c,d=0;
    for(int i=1;i<101;i++)
    {c=0;
        for(int j=1;j<101;j++)
        {
            if(ct[j]>0)
            c+=ct[j]/i;
        }
        if(c>=n)
        d=i;
    }
cout<<d<<endl;
    return 0;
}

#include <iostream>
#include <cstdio>
#include <stdlib.h>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <ctime>
#define maxn 320007
#define N 200005
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define lowbit(x) (x&(-x))
#define eps 0.000000001
#define read(x) scanf("%d",&x)
#define put(x) printf("%d\n",x)
#define memset(x,y) memset(x,y,sizeof(x))
#define Debug(x) cout<<x<<" "<<endl
#define lson i << 1,l,m
#define rson i << 1 | 1,m + 1,r
using namespace std;
typedef long long ll;
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
    int a[200];
    int n,m;
    while(cin>>n>>m)
    {
        int ans=0;
        memset(a,0);
        for(int i=1; i<=m; i++)
        {
            int t;
            cin>>t;
            if(a[t]==0)
            {
                ans++;
            }
            a[t]++;
        }
        sort(a+1,a+101,cmp);
        int b[210];
        int maxx=-1;
        int num=0;
        int flag=0;
        memset(b,0);
        for(int i=1; i<=200; i++)
        {
            int index=0;
            for(int j=1; j<=ans; j++)
            {
                if(a[j]/i)
                {
                    int t=a[j]/i;
                    index+=t;
                }
            }
            b[i]=index;
        }
        for(int i=1; i<=200; i++)
        {
            if(b[i]>=n)
                flag=i;
        }
        cout<<flag<<endl;
    }
    return 0;
}

#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;

struct cmp{
    bool operator()(const int &a, const int &b){
        return a < b;
    }
};

priority_queue<int, vector<int>, cmp> pq;

int a[107];
int main(){
    ios::sync_with_stdio(false);
    int n, m, buffer;
    cin >> n >> m;
    if(m < n){
        cout << 0 << endl;
        return 0;
    }
    for(int i = 1; i <= m; i++){
        cin >> buffer;
        a[buffer] += 1;
    }
    int i;
    bool isJ = true;
    for(i = m / n; i >= 2; i--){
        for(int i = 1; i <= 100; i++){
            if(a[i])
                pq.push(a[i]);
        }
        isJ = true;
        for(int j = 1; j <= n; j++){
            buffer = pq.top();
            buffer -= i;
            if(buffer < 0){
                isJ = false;
                break;
            }else{
                pq.pop();
                pq.push(buffer);
            }
        }
        if(isJ)
            break;
        while(!pq.empty())
            pq.pop();
    }
    if(!isJ)
        cout << 1 << endl;
    else
        cout << i << endl;
    return 0;
}

#include <iostream>

#include <cstdio>

#include <cstring>

#include <map>

#include <set>

using namespace std;

int n,m;

int pre[105];

int main()

{

	memset(pre,0,sizeof(pre));

	scanf("%d%d",&n,&m);

	for(int i=0;i<m;i++){

		int x;

		scanf("%d",&x);

		pre[x]++;

	}

	if(n > m){

		printf("0\n");

		return 0;

	}

	int ans = m / n;

	int flag = 0;

	int num;

	while(1){

		num = 0;

		for(int i=1;i<=100;i++){

			if(pre[i] >= ans){

				num += pre[i]/ans;

			}

			if(num >= n){

				flag = 1;

				break;

			}

		}

		if(flag)break;

		ans--;

	}

	printf("%d\n",ans);

	return 0;

}

#include<iostream>
#include<map>
using namespace std;

inline bool check(map <int, int> m, int n, int mid)
{
    int ans = 0;
    if(mid == 0)
    return 1;
    for(auto it = m.begin(); it != m.end(); ++it)
    {
        ans += (it->second/mid);
    }
    return ans >= n;
}

int main()
{
    // int t;
    // scanf("%d", &t);
    // while(t--)
    // {
        int n, mi, food, mymax = 0;
        map <int, int> m;
        scanf("%d%d", &n, &mi);
        for(int i = 0; i < mi; i++)
        {
            scanf("%d", &food);
            m[food]++;
        }
        // cout<<t<<"\n";
        // for(auto it = m.begin(); it != m.end(); ++it)
        // {
        //     cout<<it->first<<" "<<it->second<<"\n";
        // }
        int total = 0;
        for(auto it = m.begin(); it != m.end(); ++it)
        {
            if(mymax < it->second)
            mymax = it->second;
            total += it->second;
        }
        if(total < n)
        {
            cout<<"0\n";
            return 0;
        }
        int lo = 0, hi = mymax, res = hi;
        while(lo <= hi)
        {
            int mid = lo + (hi - lo)/2;
            if(check(m, n, mid))
            {
                res = mid;
                lo = mid + 1;
            }
            else
            {
                hi = mid - 1;
            }
        }
        printf("%d\n", res);
    // }
    // return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<char> vc;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
const double EPS = 1e-9;
const int INF = 1 << 29;
#define mp make_pair
#define el putchar('\n')
#define sp putchar(' ')
#define Fill(a, val) memset(a, val, sizeof a)
#define all(a) a.begin(), a.end()
#define tr(a, it) for (typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define in(n) scanf("%d", &n)
#define inl(n) scanf("%I64d", &n)
#define out(n) printf("%d", n);
#define outl(n) printf("%I64d", n);

int const NN = 2e5 + 5;
int a[NN];

int solve(vi v, int n){
	int sum = 0;
	tr(v, it) sum += (*it);
	int m = v.size();
	int days = 0;
	while(true){
		bool ok = true;
		for(int i=0;i<n;++i){
			int ptr = i%m;
			if(v[ptr] == 0){
				ok = false;break;
			}
			--v[ptr];
		}
		if(!ok)break;
		++days;
	}
	if(days == 0)
		days = sum >= n;
	return days;
}

int main(){
	int n, m;cin>>n>>m;
	map<int, int>cnt;
	for(int i=1;i<=m;++i){
		cin>>a[i];++cnt[a[i]];
	}
	vi v;
	tr(cnt, it){
		v.push_back(it->second);
	}
	sort(all(v));
	reverse(all(v));
	int sz = v.size();
	int ans = 0;
	for(int i=0;i<min(n, sz);++i){
		vi u;
		for(int j=0;j<=i;++j)u.push_back(v[j]);
		ans = max(ans, solve(u, n));
	}
	cout<<ans;el;
	return 0;
}

#include <cstdio>
using namespace std;
int cnt[105];
int main()
{
	int n, m;
	int ans = 0;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++)
	{
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
	for (ans = m / n; ans >= 1; ans--)
	{
		int tmp = 0;
		for (int j = 1; j <= 100; j++)
		{
			tmp += cnt[j] / ans;
		}
		if (tmp >= n)
			break;
	}

	printf("%d\n", ans);
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,m;
    cin>>n>>m;
    map<ll,ll> mp;
    ll a[m];
    for(ll i=0;i<m;i++)
    {
        cin>>a[i];
        mp[a[i]]++;
    }
    ll ans=0;
    for(ll d=1;d<m+1;d++)
    {
        ll c=0;
        set<ll> s;
        for(int i=0;i<m;i++)
        {
            if(s.count(a[i])==false)
            {
                c+=mp[a[i]]/d;
                s.insert(a[i]);
            }
        }
        if(c>=n)
            ans=d;
    }
    cout<<ans<<endl;
}

#include <stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a;
    int arr[101]={0};

    int i,j;
    for(i=0;i<m;i++)
    {
        cin>>a;
        arr[a]++;
    }
    int count=0;
    int max=0;
    int num=0;
   sort(arr,arr+101,greater<int>());

if (n>m)
    cout<<0;
else
 {

 for(i=1;i<=100;i++)
  {num=0;
    for(j=0;j<m;j++)
    {
        num+=arr[j]/i;
    }
    if (num>=n)
        max=i;
  }

  cout<<max;
  }
    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 105;
int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m) == 2){
        int p[maxn] = {0},a;
        for(int i = 0; i < m; ++i){
            scanf("%d",&a);
            p[a]++;
        }
        if(n > m)
            printf("0\n");
        else{
          sort(p,p + maxn);
          int tem = 0,ans = m/n,f = n;
         /* for(int i = maxn - 1; i >= 0; --i){
           if(p[i] == 0)break;
            printf("%d\n",p[i]);
          }*/
           for(int i = maxn-1; i >= 0;--i){
            if(ans < 0){
                ans = 0;break;
            }
            if(ans == 0){
                ans = 1;break;
            }
            if(p[i]/ans > 1)
                tem += (p[i]/ans - 1);
            if(p[i]/ans == 0){
                tem--;
            }
            if(tem < 0 ){
               f = n; tem = 0;ans--;i = maxn;continue;
            }
            f--;
            if(f == 0)break;
           }
           printf("%d\n",ans);
        }
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool isAble(vector<long long> &used, long long t, int n) {
	long long sum = 0;
	for (size_t i = 0; i < used.size(); i++)
		sum += used[i] / t;
	return sum >= n;
}
int main()
{
	long long n;
	long long m;
	cin >> n >> m;
	vector<long long> a;
	vector<long long> used;
	for (long long i = 0; i < m; i++) {
		long long temp;
		cin >> temp;
		auto it = find(a.begin(), a.end(), temp);
		if (it == a.end()) {
			a.push_back(temp);
			used.push_back(1);
		}
		else used[it - a.begin()]++;
	}
	long long left = 0;
	long long right = m + 1;
	long long mid;
	while (left + 1 < right) {
		mid = left + (right - left) / 2;
		if (isAble(used, mid, n)) left = mid;
		else right = mid;
	}
	cout << left;
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 100;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> c(N + 1);
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        c[a]++;
    }
    for (int d = N; d >= 1; d--) {
        vector<int> cc(c);
        int k = 0;
        for (int i = 1; i <= N; i++)
            while (cc[i] >= d) {
                k++;
                cc[i] -= d;
            }
        if (k >= n) {
            cout << d << endl;
            return 0;
        }
    }
    cout << 0 << endl;
}

#include<iostream>
#include<algorithm>
using namespace std;
bool cmp(int a,int b){
    return a>b;
}
int main(){
    int i,a,n,m;
    int s,maxu;
    int array[100];
    cin>>n>>m;
    for(i=0;i<100;i++){
        array[i]=0;
    }
    for(i=0;i<m;i++){
        cin>>a;
        array[a-1]++;
    }
    sort(array,array+100,cmp);
    for(maxu=0;maxu<=100;maxu++){
        s=0;
        for(i=0;i<100;i++){
            s+=array[i]/(maxu+1);
            if(s>=n)
                break;
        }
        if(i==100)
            break;
    }

    cout<<maxu<<endl;

    return 0;
}

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int map[256];
int a[101];
int main()
{
	int n, m, t;
	while (cin >> n >> m)
	{
		memset(map, 0, sizeof(map));
		for (int i = 0; i < m; i++)
		{
			cin >> t;
			map[t] ++;
		}
		int day = 100;
		for (day = 100; day > 0; day--)
		{
			int count = 0;
			for (int type = 0; type <= 100; type++)
			{
				count += map[type] / day;
			}
			if (count >= n)
				break;
		}
		cout << day << endl;
	}
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long  LL;

map<int,int> mp;

int main(){
    int n, m, i, p, j;
    int x;
    scanf("%d%d", &n, &m);
    for(i = 1; i <= m; i++){
        scanf("%d", &x);
        mp[x]++;
    }
    if(m < n) printf("0\n");
    else{
        p = m / n;
        map<int,int>::iterator it1;
        for(i = p; i > 0; i--){
            int sum = 0;
            for(it1 = mp.begin(); it1 != mp.end(); it1++){
               sum += it1->second / i;
            }
            if(sum >= n) break;
        }
        printf("%d\n", i);
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;
#define wfor(i,j,k) for(i=j;i<k;++i)
#define mfor(i,j,k) for(i=j;i>=k;--i)
bool cmp (int a, int b)
{
	return a > b;
}
int main()
{
	std::ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	int i;
	multiset <int> set1;
	int ans[200] = {0};
	wfor(i, 0, m)
	{
		int t;
		cin >> t;
		ans[t]++;
	}
	sort(ans, ans + 200, cmp);
	int cnt = 0;
	wfor(i, 0, m)
	{
		if (cnt == n)
			break;
		if (ans[i] != 0)
		{
			set1.insert(ans[i]);
			cnt++;
		}
	}
	if (n < m)
	{
		if (set1.size() != 1 && set1.size() >= n)
		{
			while (*set1.begin() <= * (set1.rbegin()) / 2)
			{
				int t = *set1.rbegin();
				set1.erase(set1.begin());
				auto it = set1.end();
				it--;
				set1.erase(it);
				set1.insert(t / 2);
				set1.insert(t - t / 2);
			}
			cout << *set1.begin() << endl;
		} else if (set1.size() == 1)
		{
			cout << *(set1.begin()) / n << endl;
		} else
		{
			while (set1.size() < n)
			{
				int t = *set1.rbegin();
				auto it = set1.end();
				it--;
				set1.erase(it);
				set1.insert(t / 2);
				set1.insert(t - t / 2);
			}
			while (*set1.begin() <= * (set1.rbegin()) / 2)
			{
				int t = *set1.rbegin();
				set1.erase(set1.begin());
				auto it = set1.end();
				it--;
				set1.erase(it);
				set1.insert(t / 2);
				set1.insert(t - t / 2);
			}
			cout << *set1.begin() << endl;
		}
	} else if (n > m)
		cout << 0 << endl;
	else if (n == m)
		cout << 1 << endl;
	return 0;
}

#include<cstdio>
#include<iostream>
using namespace std;

const int maxn = 110;

int a[maxn];

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		int x;
		scanf("%d", &x);
		a[x]++;
	}
//	for (int i = 1; i <= 5; i++)
//		cout << a[i] << endl;
	int t = m / n;
	if (t == 0)
	{
		puts("0");
		return 0;
	}
//	cout << t << endl;
	int day = 0;
	int sum;
	for (int i = t; i >= 1; i--)
	{
		sum = 0;
//		cout << i << endl;
		for (int j = 1; j <= 100; j++)
			if (a[j])
				sum += a[j] / i;
//		cout << sum << endl;
		if (sum >= n)
		{
			day = i;
			break;
		}
	}
	printf("%d\n", day);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
#include<stdlib.h>
#define eps 1e-8
#define memset(a,v) memset(a,v,sizeof(a))
using namespace std;
int max1(int a,int b)
{
    if(a>b)
        return a;
    else
        return b;
}
int main()
{
    int a,b,i,j,x[10000],y[10000]={0},max1=-0x3f3f3f3f,z[1000],k,ans,t,s,c,max2;
    scanf("%d %d",&a,&b);
        k=0;ans=0;t=0;
        for(i=0; i<b; i++)
        {
            scanf("%d",&x[i]);
            if(x[i]>max1)
                max1=x[i];
            y[x[i]]++;
        }
        for(i=0; i<=max1; i++)
        {

            if(y[i]!=0)
                z[k++]=y[i];
        }
        sort(z,z+k);c=0;
        for(i=1;i<=b/a;i++)
        {
            s=i*a;
            for(j=0;j<k;j++)
            {
                s-=z[j]/i*i;
                if(s<=0)
                    break;
            }
            if(s<=0)
                c=max(c,i);
        }
        printf("%d\n",c);
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <string.h>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#include <stdio.h>
#include <stack>

using namespace std;
#define mp make_pair
#define ll long long
string s;
string mas[250];
map < int, int > sl;
vector <pair <int, int> > vec;
int n, k, m, c = 0, v, lv, mx = -1;

int b_s(int m) {
	int l, r, h = 0;
	for (int i = 0; i < lv; ++i) {
		h += vec[i].second / m;
	}
	if (h < n)
		if (m == 1)
			return 0;
		else
			return b_s(m - 1);
	else
		return m;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	scanf("%d%d", &n, &k);
	for (int i = 0; i < k; ++i) {
		scanf("%d", &v);
		++sl[v];
	}
	for (auto i = sl.begin(); i != sl.end(); ++i) {
		v = (*i).second;
		vec.push_back(mp((*i).first, v));
		if (mx < v)
			mx = v;
	}
	lv = vec.size();
	printf("%d", b_s(mx));
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int t[105],cnt[105],n,m,a;
int main()
{
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>a;
        t[a]++;
    }
    for(int i=1;i<=100;i++)
    {
        cnt[t[i]]++;
    }
//    for(int i=1;i<=10;i++)
//    {
//        cout<<cnt[i]<<" ";
//    }
    for(int num=1;num<=101;num++)
    {
        int temp=0;
        for(int i=1;i<=100;i++)
        {
            temp+=i/num*cnt[i];

        }
        //cout<<temp<<endl;
        if(temp<n)
        {
            cout<<num-1<<endl;break;
        }
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int a[110],n;
bool check(int x){
    int num=0;
    for(int i=0;i<=100;i++){
        if(a[i]>=x)
            num+=a[i]/x;
    }
    return num>=n;
}

int main(){
    int m;
    scanf("%d%d",&n,&m);
    int x;
    int num=0;
    for(int i=0;i<m;i++){
        scanf("%d",&x);
        a[x]++;
    }
    int l=1,r=100,mid,pos=0;
    while(l<=r){
        mid=(l+r)>>1;
        if(check(mid)){
            pos=mid;
            l=mid+1;
        }else r=mid-1;
    }
    printf("%d\n",pos);
    return 0;
}

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main() {
	int m,n;
	cin >> n >> m;
	int* food;
	food=new int[m];
	for(int i=0;i<m;i++)
	cin >> food[i];
	int had=m/n;
	if(had==0 || had==1)
	{
		cout << had;
	}
	else
	{

		int exist[100];
		for(int i=0;i<100;i++)
		exist[i]=0;
		int e=0;
		int kol[100];
		for(int i=0;i<m;i++)
		{
			for(int j=1;j<=100;j++)
			{
				if(food[i]==j)
				{

					exist[j]+=1;
					break;
				}
			}
		}
		for(int i=0;i<100;i++)
		{
			if(exist[i]>0)
			{
				kol[e]=exist[i];
				e++;
			}
		}
		for(int i=0;i<e;i++)
		{
			for(int j=i+1;j<e;j++)
			{
				if(kol[j]>kol[i])
				{
					int temp=kol[i];
					kol[i]=kol[j];
					kol[j]=temp;
				}
			}
		}
		int check;
		int possible=0;
		for(int j=had;j>0;j--)
		{
			check=0;
			for(int i=0;i<e;i++)
			{
				check+=kol[i]/j;
			}
			if(check>=n)
			{
				possible=j;
				break;
			}

		}
		cout << possible;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int N = 100 + 5;
int n, m, cnt[N], num;

bool cmp(const int& a, const int& b){
    return a > b;
}

int sum(int day){
    int res = 0;
    for(int i = 0; cnt[i] >= day && res <= n; i++) res += cnt[i] / day;
    //printf("%d %d\n", day, res);
    return res;
}

int main()
{
    //memset(cnt, 0, sizeof(cnt));
    //num = 0;
    scanf("%d %d", &n, &m);
    if(m < n){
        char s[N];
        scanf("%s", s);
        puts("0");
        return 0;
    }
    int x;
    for(int i = 0; i < m; i++){
        scanf("%d", &x);
        cnt[x]++;
    }
    sort(cnt, cnt + N, cmp);
    int l = 1, r = m / n, mid, p = -1;
    while(l <= r){
        mid = (l + r) >> 1;
        if(sum(mid) < n) r = mid - 1;
        else l = mid + 1, p = mid;
    }
    printf("%d\n", p);
    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n, m;
    cin >> n >> m;
    vector < ll > v,w;
    map < ll , ll > mp,mapa;
    for(int i=0;i<m;i++)
    {
        ll a;
        cin >> a;
        v.push_back(a);
        mp[a]++;
    }
    for(int i=0;i<m;i++)
    {
        mapa[v[i]]++;
        if(mapa[v[i]]==1)
        {
            w.push_back(mp[v[i]]);
        }
    }
    sort(w.rbegin(),w.rend());
    ll mx=0;
    for(int i=1;i<=100;i++)
    {
        ll cnt=0;
        set < ll > st;
        for(int j=0;j<w.size();j++)
        {
            ll div=w[j]/i;
            cnt+=div;
            if(cnt>=n)
            {
                mx=i;
                break;
            }
        }
    }
    cout << mx << endl;
}

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
#define wfor(i,j,k) for(int i=j;i<k;++i)
#define mfor(i,j,k) for(int i=j;i>=k;--i)
int main()
{
	std::ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	int res = 0;
	int temp = 1000000;
	int ans[200] = {0};
	wfor(i, 0, m)
	{
		int t;
		cin >> t;
		ans[t]++;
	}
	sort(ans, ans + 200, greater<int>());
	while (temp >= n)
	{
		res++;
		temp = 0;
		wfor(i, 0, m)
		{
			if (ans[i] == 0)
				break;
			else
			{
				temp += ans[i] / res;
			}
		}
	}
	cout << res - 1 << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a[m];int b[105]={0};int k=0;
    for(int i=0;i<m;i++)
    {
        cin>>a[i];  b[a[i]]++;
    }
    //sort(a,a+m);
    //int b[m]={1};
  /*  for(int i=0;i<m-1;i++)
    {
        if(a[i]==a[i+1])
        {
            b[k]=b[k]+1;
        }
        else k++;
    }
    cout<<k;*/

        int y=0;int s=0;;
   for(int i=m;i>0;i--)
   {  s=0;
       for(int j=0;j<105;j++)
       {
           s=s+b[j]/i;
       }
       if(s>=n)
       {
           y=i; break;
       }
   }
   cout<<y;

}

//KrisjanisP
//for safety use C++11
#include <bits/stdc++.h>
#define ll      long long int
#define uns     unsigned
#define INF     1e9
#define INF2    ((ll)1e18)
#define pii     pair<ll,ll>
#define x       first
#define y       second
#define vi      vector<ll>
#define pb      push_back
#define sz(a)   (ll)((a).size())
#define all(x)  (x).begin(), (x).end()
#define m_u(x)  sort(all((x))), x.resize(unique(all(x))-x.begin())
#define FIO     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//iota(all(vec), 0)

using namespace std;

//Binary Exponention
ll BE(ll a, ll b, ll m){
    a %= m; ll res = 1;
    while(b>0){
        if(b&1) res*=a, res%=m;
        a*=a;
        a%=m;
        b >>= 1;
    }
    return res;
}

//Extended Euclidean Algorithm
ll GCD(ll a, ll b, ll &x, ll &y){
    if(a==0){
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll g = GCD(b%a, a, x1, y1);
    x = y1-((ll)(b/a)*x1);
    y = x1;
    return g;
}

//Sieve Of Eratosthenes
void SOE(ll n, bool p[]){
    for(int i=0;i<=n;i++) p[i] = 1;
    p[0] = p[1] = 0;
    for(ll i=2;i*i<=n;i++){
        if(!p[i]) continue;
        for(ll j=i*i;j<=n;j+=i){
            p[j] = 0;
        }
    }
}

const ll mxN = 1e5;
const ll mod = 1;

int main(){
    FIO;

    int cnt[100] = {};
    int n, m;
    cin>>n>>m;
    int A[m]; for(int i=0;i<m;i++) cin>>A[i], A[i]--, cnt[A[i]]++;
    sort(cnt, cnt+100, greater<int>());
    int res = 0;
    while(1){
        res++;
        int p = n;
        for(int i=0;p&&i<n;i++){
            p -= cnt[i]/res;
        }
        if(p>0) break;
    }
    cout<<res-1;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n,m;
    cin>>n>>m;

    int count[101];
    for(int i=0;i<101;i++)
        count[i]=0;
    for(int i=0;i<m;i++)
    {
        int d;
        cin>>d;
        count[d]++;
    }
    sort(count,count+101);
    int ans=0;
    int rtemp;
    for(int i=100;i>0;i--)
    {
         rtemp=n;
        for(int j=100;count[j]!=0;j--)
        {
            if(rtemp<=0)
                break;
            if(count[j]<i )
                break;
            else
            {

                rtemp-=count[j]/i;
            }
        }
        if(rtemp<=0)
        {
         //   cout<<11<<endl;
                ans=i;
                break;
        }
    }
    cout<<ans;

}

// -> limitless <- //
#include<bits/stdc++.h>
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
#define lp(i, n) for (int i = 0; i < (int)(n); ++i)
#define read(n) scanf ("%d", &n)
using namespace std;
typedef unsigned long long ll;
    const int N = 5e5 + 5;
    const int mod = 1<<30;
    int n, k;
    int arr[102] = {};
    vector<int> ans;

int main()
{
    read(n), read(k);
    lp(i, k){int a; read(a); arr[a]++;}
    for(int i = 0; i < 102; i++)
        if(arr[i])ans.PB(arr[i]);
    sort(ans.rbegin(), ans.rend());
    for(int i = 1; i < 102; i++){
            int res = 0;
        for(int j = 0; j < (int)ans.size(); j++)
            res += ans[j]/i;
        if(res < n){
            cout << i-1;
            return 0;
        }
    }
    return 0;}

#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b){return (a>b);}
int main()
{
    int n,m;
    int a[505];
    vector<int> v;
    cin>>m>>n;
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++){
        int input;
        cin>>input;
        a[input]++;
    }
    for(int i=0;i<500;i++) if(a[i]) v.push_back(a[i]);
    sort(v.begin(), v.end(), comp);
    int ans=0;
    int temp=0;
    int low =1;
    int high= 104;
    while(low <= high)
    {
        int k = (high+low)/2;
        temp=0;
        for(int i=0;i<v.size();i++)
        {
            temp += v[i]/k;
        }
        if(temp >= m) {
        ans = max(ans,k);
        low = k+1;
        }
        else high = k-1;
    }
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
#include <iomanip>
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mkp(a,b) make_pair(a,b)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define fi first
#define se second
#define stn(a) setprecision(a)//小数总有效位数
#define stfl setiosflags(ios::fixed)//点后位数:cout<<stfl<<stn(a);
//#pragma GCC optimize("unroll-loops")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1);
const int inf = 0x3f3f3f3f; //9
const ll inff = 0x3f3f3f3f3f3f3f3f; //18
template <class T>
bool scan_d(T &ret)
{
    char c;int sgn;T bit=0.1;
    if(c=getchar(),c==EOF) return 0;
    while(c!='-'&&c!='.'&&(c<'0'||c>'9')) {c= getchar();}
    sgn=(c=='-')?-1:1; ret=(c=='-')?0:(c-'0');
    while(c=getchar(),c>='0'&&c<='9') {ret=ret*10+(c-'0');}
    if(c==' '||c =='\n') {ret*=sgn;return 1;}
    while(c=getchar(),c>='0'&&c<='9') {ret+=(c-'0')*bit,bit/=10;}
    ret*=sgn; return 1;
}

int n,m;
int a;
int cnt[110];
int b[110];
int len;

bool judge(int mid)
{
    int pep=0;
    for(int i=0;i<len;i++)
    {
        pep+=b[i]/mid;
    }
    if(pep<n)
        return false;
    else
        return true;
}

bool cmp(int a,int b)
{
    return a>b;
}

int main()
{
    fio;
    cin>>n>>m;
    int dif=0;
    for(int i=0;i<m;i++)
    {
        cin>>a;
        cnt[a]++;
    }
    int j=0;
    for(int i=0;i<105;i++)
        if(cnt[i])
            b[j++]=cnt[i];
    len=j;
    sort(b,b+len,cmp);

    int le=0,ri=10010;
    while(le+1<ri)
    {
        int mid=(le+ri)/2;
        if(judge(mid))
            le=mid;
        else
            ri=mid;
    }

    cout<<le<<endl;
}

#include<algorithm>
#include<iostream>
using namespace std;
int a[101];
int main(){
	int n,m;
	cin>>n>>m;
	if(n>m){
		cout<<'0';
		return 0;
	}
	if(n==m){
		cout<<'1';
		return 0;
	}
	for(int i=1;i<=m;i++){
		int x;
		cin>>x;
		a[x]++;
	}
	int ans=0;
	for(int i=1;i<=m;i++){
		int t=0;
		for(int j=1;j<=100;j++)
			t+=a[j]/i;
		if(t>=n)
			ans=max(ans,i);
	}
	cout<<ans;
}

#include<cstdio>

#include<cstring>

#include<map>

#include<algorithm>

using namespace std;

map<int,int>mp;

int main()
{
    int n,m,i,j,dn,x,p,sz;
    scanf("%d%d",&n,&m);
    for(i=1; i<=m; i++)
    {
        scanf("%d",&x);
        mp[x]++;
    }
    if(m<n)
    {
        printf("0\n");
        return 0;
    }
    p=m/n;
    map<int,int>::iterator it;
    for(i=p; i>0; i--)
    {
        sz=0;
        for(it=mp.begin(); it!=mp.end(); it++)
        {
            sz+=it->second/i;
        }
        if(sz>=n)
            break;
    }
    printf("%d\n",i);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[105];
int b[105];
int main ()
{
  int n,m;
  cin>>n>>m;
  set<int> s;
  for(int i= 1;i<=m;i++)
  {
    cin>>a[i];
   b[a[i]]++;
  }
  //for(int i= 1;i<=m;i++)
   //cout<<b[i]<<" ";
  int x = m/n;
  if(x<1) cout<<0<<endl;
  else
  {
    for(int i= 1;i<=m;i++) s.insert(a[i]);
    int t = (int)s.size();
    if(t == 1) cout<<x<<endl;
    else if(t == m) cout<<1<<endl;
    else {
     for(;x>=1;)
     {
       int cnt= 0;
       for(int i =1;i<=105;i++)
       {
         if(b[i]>=x)
         cnt+=b[i]/x;
       }
       if(cnt>=n)
       {
         cout<<x<<endl;
         return 0 ;
       }
       else x--;
     }
     cout<<0<<endl;
  }
}
  return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
int vis[101];
int main(){
	int n,m,x,s=0,i,j,t;
	cin>>n>>m;
	for(i=0;i<m;i++)cin>>x,vis[x]++;
    for(i=1;i<=m;i++){
    	t=0;
        for(j=1;j<=100;j++)t+=vis[j]/i;
        if(t>=n)s=max(s,i);
	}
	cout<<s;
	return 0;
}

#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define M        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll n,m;
    cin>>n>>m;

    map <ll,ll> c;

    ll x;

    for(ll i=0; i<m; i++){
        cin>>x;
        c[x]++;
    }

    vector <ll> v;

    for(auto it=c.begin(); it!=c.end(); it++) v.pb(it->S);

    sort(all(v));

    ll mx = 0, val=0;

    for(ll k=1; k<=100; k++){
        ll s=0;
        for(ll i=0; i<v.size(); i++) {s+=v[i]/k; if(s>=n) break;}
        if(s>=n and k>=val) {val=k; mx=s;}
    }

    cout<<val;

	return 0;
}

/* Author - Ankur Kumar Singh
    	IDE :- Offine Linux
     ---------------------------------*/
    #include <bits/stdc++.h>
	#include <limits.h>
	#include <stdio.h>
	#include <stdlib.h>
    using namespace std;
    /* variable type :- */
    	/* variable type :- */
    	# define ll  long long int
    	# define ld  long double
    	# define mod 998244353
    /* map */
    	# define cdf  pair<long long int,long long int>
        //map < pair < cdf,cdf > , long long int > abc;
	map<ll,ll,greater<ll>>yz;
    /* vector */
    	# define pb push_back
    	# define pp pop_back
    	# define ff first
    	# define ss second
    	# define mp make_pair
    	# define ac accumulate
    	vector<pair<ll,string>>a1;
	vector<pair<ll,ll>>a2;
	vector<pair<ll,pair<ll,ll>>>a3;
	vector<ll>ary[100005];
bool isSubSequence(string str1,string str2, ll m, ll n)
{
    if (m == 0) return true;
    if (n == 0) return false;
    if (str1[m-1] == str2[n-1])
        return isSubSequence(str1, str2, m-1, n-1);
    return isSubSequence(str1, str2, m, n-1);
}
ll fac[5015];
void output2(ll t)
{
	if(t>2)
	{
		cout<<"3"<<" "<<"1"<<"\n";cout<<"3"<<" "<<"2"<<"\n";
		for(ll i=2;i<t-1;i++)
		{
			cout<<"3"<<" "<<i+2<<"\n";
		}
	}
	else
	{
		//cout<<"2"<<" "<<"1"<<"\n";
		for(ll i=0;i<t-1;i++)
		{
			cout<<"1"<<" "<<i+2<<"\n";
		}
	}
}
 int  main()
    {
        #ifndef ONLINE_JUDGE
    	freopen("inout.txt", "r", stdin);
    	freopen("output6.txt", "w", stdout);
    	#endif
    	ios_base::sync_with_stdio(false);
        	cin.tie(NULL);
	ll n,m;
	cin>>n>>m;
	set<ll>ele;
	ll arr[m+3],freq[1002]={0};
	vector<ll>ans;
	for(ll i=0;i<m;i++)
	{
		cin>>arr[i];
		freq[arr[i]]++;
		if(!ele.count(arr[i]))
		{
			ele.insert(arr[i]);
			ans.pb(arr[i]);
		}
	}
	ll low=0,high=1e18,answer=0;
	while(low<=high)
	{
		ll mid=(low+high)/2;
		ll sum=0;
		if(mid==0)
		{
			low=mid+1;
			answer=max(answer,mid);
			continue;
		}
		for(ll i=0;i<ans.size();i++)
		{
			sum=sum+(freq[ans[i]]/mid);
		}
		//cout<<mid<<" B "<<sum<<" "<<low<<" "<<high<<endl;
		if(sum>=n)
		{
			low=mid+1;
			answer=max(answer,mid);
		}
		else
			high=mid-1;
		//cout<<mid<<" "<<sum<<" "<<low<<" "<<high<<endl;
	}
	cout<<answer<<"\n";
	return 0;
    }

#include<cstdio>
#include<algorithm>
#pragma GCC optimize(3)
bool cp(int a,int b) {
	return a>b;
}
int mx=-1;
int chart[105][105],min,b[105],n,tmp,m,ts,tim;
void dfs(int x,int times,int tot,int min) {
    ++tim;
    if(tim>156124938)
	{
	    mx=1;
	    return;
	}
	if(mx>=min)return;
	//printf("%d %d %d %d\n",x,times,tot,min);
	if(tot==n)
	{
	    if(min==214748)
	        return;
	    mx=std::max(mx,min);
	    return;
	}
	if(x==ts)return;
	if(times>0)
	    dfs(x+1,0,tot,std::min(min,chart[x][times]));
	else
	    dfs(x+1,0,tot,min);
	if(chart[x][times+1])
		dfs(x,times+1,tot+1,std::min(min,chart[x][times+1]));
	return;
}
int main() {
	scanf("%d%d",&n,&m);
	if(m>=n&&m<2*n)
	{
	    printf("1");
	    return 0;
	}
	if(m<n)
	{
	    printf("0");
	    return 0;
	}
	for(int i=0; i<m; ++i) {
		scanf("%d",&tmp);
		b[tmp]++;
	}
	std::sort(b+1,b+101,cp);
	for(int i=1; i<=100; ++i) {
	    ts++;
		if(b[i]==0)
			break;
		chart[i][1]=b[i];
		for(int j=2; j<=n; ++j) {
			if(b[i]>=j)
				chart[i][j]=b[i]/j;
			else
			    break;
		}
	}
	dfs(1,0,0,214748);
	if(mx==-1)
	    printf("0");
	else
	    printf("%d",mx);
	return 0;
}

#include <iostream>
#include <unordered_map>

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);

    int n, m;
    std::cin >> n >> m;

    if (n > m)  // 僧多粥少，明显一天都走不动
    {
        std::cout << 0 << std::endl;
    }
    else if (n == m)    // 刚好相等，一人一口，一天吃完
    {
        std::cout << 1 << std::endl;
    }
    else
    {
        std::unordered_map<int, int> Map;
        for (int i = 0; i < m; ++i) // 统计每个数各出现了多少次
        {
            int t;
            std::cin >> t;
            ++Map[t];
        }
        for (int k = m / n; k >= 1; --k)        {
            int Tol = 0;
            for (const auto &r : Map)
            {
                Tol += r.second / k;
            }

            if (Tol >= n)               {
                std::cout << k << std::endl;

                break;
            }
        }
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    //dsfdf
	int n,m;
	cin >>n>>m;
	int a[102] ={0};
	for(int i=0;i<m;i++){
		int num;
		cin >>num;
		a[num]++;
	}
	sort(a,a+102,greater<int>());
	int ans=0;
	int n2 =n;
	for(int i=1;i<=102;i++){
		int temp[102];
		for(int i=0;i<102;i++){
			temp[i] = a[i];
		}
		n =n2;
		int ind=0;
		int flag=0;
		while(true){
			n = n-(temp[ind]/i);
			if(n<=0){
				ans =i;
				break;
			}
			if(n>0){
				ind++;
			}
			if(temp[ind]==0){
				flag=1;
				break;
			}
		}
		if(flag==1){
			break;
		}
	}
	cout << ans;
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

bool cmp(int a,int b){
    return a>b;
}

int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int a[105]={0};
    for(int i=0;i<m;i++){
            int x;
        scanf("%d",&x);
        a[x]++;
    }
    sort(a+1,a+101,cmp);
    int ans=0;
    for(int i=n;i>0;--i){
            bool f=true;
            int t=n,d=a[1]/i;
            if(d==0)continue;
        for(int j=1;t>0&&d>0;++j){
            while(a[j]<d)d--;
            if(d==0)break;
            t-=a[j]/d;
        }
        if(t<=0)
            ans=max(ans,d);
    }
    printf("%d\n",ans);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,m;

int num[105];
int main()
{
	scanf("%d%d",&n,&m);
	int x;
	for(int i = 0; i < m; i++)
	{
		scanf("%d",&x);
		num[x]++;
	}
//    for(int i = 1; i <= 100 ;i ++){
//        printf("%d %d\n",i, num[i]);
//    }
	if(n > m) printf("0\n");
	else
	{
		int ans = 0;
		for(int i = 1; i <= 100; i++)
		{
			int sum = 0;
			for(int j = 1; j <= 100; j++)
			{
				sum += (num[j] /i) ;
			}
			if(sum >= n)
			{
				//   printf("%d\n",i);
				ans = i;
			}
			else break;
		}
		printf("%d\n",ans);
	}
}

#include <iostream>

using namespace std;

int n, m, k;
int a[100];
int x[100];
int f[100]; // is frequent of appear x[i]

void swap(int &a, int &b)
{
	int tem = a;
		a = b;
		b = tem;
}
void sort(int m,int*a)
{
	for (int i = 0; i < m; i++)
		for (int j = i + 1; j < m; j++)
			if (a[i] > a[j])
				swap(a[i], a[j]);
}
void input(int &n, int&m, int*a)
{
	cin >> n;
	cin >> m;

	for (int i = 0; i < m; i++)
		cin >> a[i];

	sort(m,a);

	x[0] = a[0];
	f[0] = 1;
	k = 1;

	for (int i = 1; i < m; i++)
		if (a[i] != a[i - 1]) {
			x[k] = a[i];
			f[k] = 1;
			k++;
		}
		else {
			f[k-1]++;
		}

}
bool check(int ans)
{
	int count = 0;

	for (int i=0;i<k;i++)
	{
		count += f[i]/ ans;
	}
	return (count>=n);
}
void searchBinary(int n, int m, int*a)
{
	int left, right, mid;
	left = 1;
	right = m / n;
	int ans = 0;

	while (left <= right)
	{
		mid = (left + right) / 2;
		if (check(mid))
		{
			ans = mid;
			left = mid + 1;
		}
		else
			right = mid - 1;
	}

	cout << ans;
}
int main()
{
	input(n, m, a);
	searchBinary(n, m, a);
    return 0;
}

/*
 *
 ********************************************************************************************
 * AUTHOR : Vijju123                                                                        *
 * Language: C++14                                                                          *
 * Purpose: -                                                                               *
 * IDE used: Codechef IDE.                                                                  *
 ********************************************************************************************
 *
 Comments will be included in practice problems if it helps ^^
 */

#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int possible(int x,int arr[])
{
    if(x==0)
        return 0;
    int counter=0;
    for(int i=1;i<=100;i++)
    {
        counter+=arr[i]/x;
    }
    return counter;
}

int main() {
	// your code goes here
	#ifdef JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
    #endif
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	int n,m,i;
	cin>>n>>m;
	int arr[m],freq[101]={0};
	for(i=0;i<m;i++)
	{
	    cin>>arr[i];
	    freq[arr[i]]++;
	}

	int low=0,high=m/n;
	int ans=0;
	if(high==0)
	{
	    cout<<0<<endl;
	    return 0;
	}
	while(low<=high and high>0)
	{
	    int mid=(low+high)>>1;
	    //cout<<"currmid="<<mid<<endl;
	    if(mid==0 and possible(1,freq)<n)
	    {
	        ans=0;
	        break;
	    }
	    else if(mid==0)
	        mid=1;
	    //cout<<"MID="<<mid<<endl;
	    if(possible(mid,freq)>=n)
	    {
	        ans=max(ans,mid);
	        low=mid+1;
	    }
	    else
	        high=mid-1;
	}
	cout<<ans<<endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;
int a[105];
int main()
{
    int z,x,s=0;
    scanf("%d %d",&z,&x);
    for(int i=0;i<x;i++){
        int t;
        scanf("%d",&t);
        a[t]++;
    }
    sort(a,a+105,greater<int>());
    int l=0,r=a[0];
    while(r>=l){
        int m=(l+r)/2,t=0;
        if(m==0){
            if(x>=z) s=r;
            else s=0;
            break;
        }
        for(int i=0;a[i]!=0;i++){
            t+=a[i]/m;
        }
        if(t>=z){
            s=max(s,m);
            l=m+1;
        }
        else r=m-1;
    }
    printf("%d",s);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    int arr[m+1]={0};
    for(int i=0;i<m;i++){
        cin>>arr[i];
    }
    sort(arr,arr+m);
    std::vector<int> v;
    int sum=0;
    for(int i=0;i<m-1;i++){
        if(arr[i]==arr[i+1]){
            sum++;
            if(arr[i]!=arr[i+2]){
                v.push_back(sum+1);
                sum=0;
            }
        }
    }
    int l=v.size();
    sort(v.begin(),v.end());
    if(n>m){
        cout<< 0;
    }
    else if(l==0){
        cout<< 1;
    }
    else if(l==1){
        if(v[0]/n > 0){cout<< v[0]/n;}
        else{cout<< 1;}
    }
    else if(l>=n){
        cout<< v[l-n];
    }
    else if(v[l-1]/n >= v[0]){cout<< v[l-1]/n;}
    else{
        int check=v[0];
        while(1){
            int sum=0;
            for(int i=0;i<l;i++){
                sum+=v[i]/check;
            }
            if(sum>=n || check==1){break;}
            else{check--;}
        }
        cout<<check;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define fr first
#define sc second
int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0},dxx[8]={0,0,1,1,1,-1,-1,-1},dyy[8]={1,-1,0,1,-1,0,1,-1};
//914836017997511610
int cnt[105];
int main()
{ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int n,m,i,j,x;
cin>>n>>m;
if(n>m)
{cout<<0;return 0;}
for(i=1;i<=m;++i)
	{cin>>x;++cnt[x];}
sort(cnt,cnt+102,greater<int>());
//int ans=cnt[0]/n,val;
bool flag;int val=0;
for(i=m;i>0;--i)
{	 val=0;
	for(j=0;j<=100;++j)
	{
		if(cnt[j]==0)
			break;
		val+=cnt[j]/i;

		if(val>=n)
			break;
	}

	if(val>=n)
		break;

}

cout<<i;
return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
#define ll long long
const int maxn = 2e3 + 10;
int a[maxn];
int b[maxn];
int top, n;
bool ok(int x) {
	int sum = 0;
	for (int i = 0; i < top; i++)
		sum += b[i] / x;
	if (sum >= n)return true;
	return false;
}
int main()
{
	int  m, x;
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> x;
		a[x]++;
	}
	int  sum=0;
	top = 0;
	for (int i = 1; i <= 100; i++)
		if (a[i] > 0) b[top++] = a[i], sum += a[i];
	int l = 0, r = sum / n + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (ok(mid)) l = mid;
		else r = mid;
	}
	cout << l << endl;
	return 0;
}

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int n,m,a[101],cnt[101],ans,maxn,tot;
int pd(int x,int y)
{
    int k=99,t;
    while(cnt[k])
    {
        t=cnt[k];
        while(1)
        if(t>=x)
        {
            t-=x;
            y--;
        }
        else
        break;
        if(y<1)
        return 1;
        k--;
    }
    return 0;
}
int main()
{
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>a[i];
        cnt[a[i]]++;
    }
    if(n>m)
    {
        cout<<0;
        return 0;
    }
    if(n==m)
    {
        cout<<1;
        return 0;
    }
    sort(cnt,cnt+100);
    for(int i=2;;i++)
    if(!pd(i,n))
    {
        cout<<i-1;
        return 0;
    }
}

#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define ld long double
#define pb push_back
#define fe first
#define se second
#define endl "\n"

#define st(x) sort(x.begin(),x.end())
#define rst(x) sort(x.rbegin(),x.rend())
const long double pi = 3.14159265358979323;
const double EPS = 1e-12;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
map < ll ,ll > mp;
ll n;
bool check(ll day)
{
    ll count = 0;
    for(auto it : mp)
    {
        count += it.second/day;
    }
    return count >= n;
}
int main()
{
    fast;
    ll m;
    cin >> n >> m;
    ll a[m];
    for(int i = 0 ; i < m ;i++){
    cin >> a[i];
    mp[a[i]]++;
    }
    if(n > m)
    return cout << 0,0;
    ll low = 0 , high = m/n  + 1,mid;
    for(int i = 0 ; i  < 8 ; i++)
    {
        mid = (low + high ) >> 1;
        if(check(mid))
        low = mid ;
        else
        high = mid ;
    }
    cout << low;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int maxn = int(1e5) + 100;
const int maxm=100;
int num[maxn];
int tmp[maxn];
bool solve(int x,int n,int m) {
	if(x==0)
		return true;
	for(int i=1; i<=maxm; i++)
		tmp[i]=num[i];
	int pos=1;
	int top=0;
	while(pos<=maxm) {
		if(tmp[pos]>=x) {
			tmp[pos]-=x;
			top++;
			if(top>=n)break;
		} else {
			pos++;
		}
	}
	if(top>=n)
		return true;
	else
		return false;
}
int main() {
	int n,m;
	int u;
	while(~scanf("%d %d",&n,&m)) {
		memset(num,0,sizeof(num));
		for(int i=1; i<=m; i++) {
			scanf("%d",&u);
			num[u]++;
		}
		int l=0,r=100;
		while(l<r){
			int mid=(l+r+1)>>1;
			if(solve(mid,n,m))
				l=mid;
			else
				r=mid-1;
		}
		printf("%d\n",l);
	}
	return 0;
}

//--@farmanalam123--//
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
void solve() {
    int n,k;
    cin>>n>>k;
    vector<int> v(k);
    map<int,int> mp;
//    if(n>k and k==1)
//    {
//        cout<<0;
//        return;
//    }
    for(auto &i:v)
    {
        cin>>i;
        mp[i]++;
    }
    //cout<<mp.size()<<" ";
    int cnt=0;
    int m=0;
    int x=n;

       for(int j=1;j<=100;++j)
       {
           cnt=0;
           for(auto &i:mp) {
               cnt+=i.second/j;
           }
           if(cnt>=n)
           {
               m=j;
           } else
               break;
       }
       cout<<m<<"\n";

//    if(m>n)
//        cout<<m/n;
//    else
//    cout<<m;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();

    return 0;
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

int n,m,a[110];
int main(){
	while((scanf("%d%d",&n,&m))!=EOF){

		map<int,int> s;
		set <int> p;
		for(int i=0;i<m;i++){
			scanf("%d",&a[i]);
			s[a[i]]++;
			p.insert(a[i]);
		}
		if(n>m) {
			printf("0\n");
			continue;
		}
		if(n==m){
			printf("1\n");
			continue;
		}
		/*if(n==1) {
			printf("%d\n",m);
			continue;
		}*/
		int cnt = m/n;
		int sum;
		set<int>::iterator it;

		while(1){
			sum = 0;
			for(it=p.begin();it!=p.end();it++){
				//printf("s[i] = %d\n",s[(*it)]);
				sum+=(s[(*it)]/cnt);
			}
			//printf("cnt = %d\n",cnt);
			//printf("sum = %d\n",sum);
			if(sum<n) cnt--;
			if(sum>=n) break;
		}
		printf("%d\n",cnt);
	}
	return 0;
}

//#include"bits/stdc++.h"
#include<iostream>
#include<string.h>
#include<algorithm>
#include<cstdio>
using namespace std;
bool cmp(int a,int b)
{
	return a>b;
}
int a[200];
int main()
{
	int n,m,i,j,x;
	scanf("%d%d",&n,&m);
	for(i=1;i<=m;i++)
	{
		scanf("%d",&x);
		a[x]++;
	}
	sort(a+1,a+101,cmp);
	int day;
	day=101;x=0;
	while(x<n&&day!=0){
		day--;x=0;
		for(j=1;a[j]!=0&&day;j++)
			x=x+a[j]/day;
		//	cout<<day<<' '<<x<<endl;
	}
	printf("%d",day);
}

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	int n , m , freq[101]={0} , ans=0 ;
	cin>>n>>m ;
	for(int i=0 ;i<m ; i++ ){
		int a ;
		cin>>a;
		freq[a]++ ;
	}
	sort( freq , freq+101) ;
	reverse (freq , freq+101) ;
	for (int d=1 ; d<=100 ; d++ ){
		int cnt =0 ;
		for(int i=0  ; i<m ; i++ )
			cnt+=freq[i]/d ;
		if ( cnt>=n )
			ans= d ;
	}
	cout<<ans << endl;
	return 0;
}

#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int count[100];
	int c;
	for(int i = 0;i < 100;i++)
	{
		count[i] = 0;
	}
	for(int i = 0;i < m;i++)
	{
		cin >> c;
		count[c-1]++;
	}
	sort(count,count+100);
	c = 0;
	for(int i = 1; i < 101;i++)
	{
		int r = 0;
		for(int j = 0; j < 100;j++)
		{
			r += count[j]/i;
		}
		if(r >= n)
		{

			c = i;
		}
	}
	cout << c << endl;
}

#include <bits/stdc++.h>
using namespace std;

#define MAX                 10000007
#define MOD                 1000000009
#define base                1000000007
#define eps                 1e-9
#define INF                 LLONG_MAX
#define inf                 LONG_MAX
#define PI                  acos(-1.0)  // 3.1415926535897932
int ara[1000],bra[1000];
int main()
{
    //freopen("input.txt","r",stdin);
   // freopen("output.txt","w",stdout);
    int n,m,temp;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
    	cin>>temp;
    	ara[temp]++;
    }
   if(n>m)
   {
   	cout<<0<<endl;
   	return 0;
   }
   for(int i=1;i<=100;i++)bra[i]=ara[i];
   	sort(bra+1,bra+101);
   int res=0;
   for(int i=1;i<=100;i++)
   {
   	temp=0;
   	for(int j=100;j>=100-n+1;j--)
   	{
   		if(bra[j]/i>0)temp+=bra[j]/i;
   		if(temp>=n)res=max(res,i);
   	}
   }
   cout<<res<<endl;
    return 0;
}

#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>
using namespace std;
#define N 510
#define INF 0x3f3f3f3f
int a[N], b[N];
int n, m, ans;

int main()
{
    cin >> n >> m;
    int cnt = 0;
    for(int i = 1; i <= m; ++i) {
        int t;
        cin >> t;
        a[t] ++;
    }
    for(int i =1; i <= 100; ++i) {
        if(a[i]) {
            b[cnt++] = a[i];
           // cout << i << " " << a[i] <<endl;
        }
    }
    sort(b, b + cnt);
    ans = 0;
    for(int j = 1; j <= 100; j ++) {
            int flag = 0;
            int num = 0;
        for(int  i = 0;  i <= cnt - 1; ++i) {
            if(b[i] < j) {
                continue;
            }else {
                num ++;
                int t = b[i] - j;
                if (t >= j) {
                    num += t / j;
                }
            }
        }
        if(num >= n)
            ans = j;
    }

    cout << ans << endl;
    return 0;
}
/*
26 13
qwertyuiopasdfghjklzxcvbnm
*/

#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int cmp(int a,int b)
{
    return a>b;
}
int main()
{
    map<int,int>mp;
    map<int,int>::iterator it;
    int n,m,b;
    int a[150],i;
    scanf("%d%d",&n,&m);
    for(i=0; i<=m-1; i++)
    {
        scanf("%d",&b);
        mp[b]++;
    }
    int t=0;
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        a[t++]=it->second;

    }
    sort(a,a+t,cmp);
    int maxx=1;
    int flag;
    for(i=a[0]; i>=1; i--)
    {
        flag=0;
        int ge=0;
        for(int j=0; j<=t-1; j++)
            ge+=a[j]/i;
        if(ge>=n)
        {
            maxx=i;
            flag=1;
            break;
        }
    }
    if(flag==0)
        printf("0\n");
    else
        printf("%d\n",maxx);

}

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define per(i,a,n) for(int i=(n-1);i>=(a);i--)
#define fi first
#define se second
typedef pair <int,int> pII;
typedef long long ll;
const int INF = 0x3f3f3f3f;
//head
int m,n;
const int maxn = 110;
int a[maxn],b[maxn];
bool cmp(int a,int b){
    return a>b;
}
int cnt,ans;
void dfs(int day,int idx,int p){
    if(p <= 0){
        ans = max(ans,day);
        return;
    }
    if(idx ==cnt) return;
    for(int i=1;i<=a[idx];i++){
        if(a[idx] / i < day) continue;
        dfs(day,idx+1,p-i);
    }
}
int main(){
#ifdef LOCAL
    freopen("2.in","r",stdin);
#endif
    scanf("%d%d",&n,&m);
    rep(i,1,m+1){
        int x;scanf("%d",&x);
        a[x]++;
    }
    ans = 0;
    sort(a+1,a+m+1,cmp);
    rep(i,1,101) if(a[i]==0) {cnt = i;break;}
    for(ans = 1;ans<=100;ans++){
        int peo = 0;
        rep(i,1,101){
            peo += a[i]/ans;
        }
        if(peo <n){
            break;
        }
    }
    printf("%d\n",ans-1);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int MAXN = 105;
int n, m;
int cnt[MAXN];

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; i++)
    {
        int x;
        scanf("%d", &x);
        cnt[x]++;
    }
    for (int i = 100; i >= 1; i--)
    {
        int sum = 0;
        for (int j = 1; j <= 100; j++)
        {
            sum += (cnt[j]/i);
        }
        if (sum >= n)
        {
            printf("%d\n", i);
            return 0;
        }
    }
    printf("0\n");
    return 0;
}

#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
typedef long long int lli;
#define FAST ios_base::sync_with_stdio(false);
#define FASTT cin.tie(NULL);
#define pb push_back
#define pf push_front
#define mp make_pair
#define ff first
#define ss second
#define ap append
using namespace std;

int main(){
    FAST;FASTT;
    int n,m,a;
    cin>>n>>m;
    int ar[101]={0};
    for(int i=0;i<m;i++){
        cin>>a;
        ar[a]++;
    }
    sort(ar,ar+101,greater<int>());
    int i=1;
    while(true){
        a=0;
        for(int j=0;j<101;j++){
            if(ar[j]<i){break;}
            else{
                a+=ar[j]/i;
            }
        }
        if(a<n){i--;break;}
        i++;
    }
    cout<<i<<endl;
}

//Vivek
#pragma optimize("", off)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:36777216")
#include <bits/stdc++.h>

#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
#define sz(i) int(i.size())
#define setto(n) cout << fixed << setprecision(n)
#define fi first
#define se second
#define mem(a, b) memset(a, b, sizeof(a))
#define len(s) int(s.length())
#define INF LONG_MAX
#define UNIQUE(a) ((a).erase(unique((a).begin(), (a).end()), (a).end()))
#define random() ((ll)rand() << 32 | rand())
#define C(c) c-'a'

using namespace std;

#ifdef ONLINE_JUDGE
#define endl '\n'
#endif
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}
template<class T> void smax(T& a, T val) {if (a < val) a = val;}
template<typename T>inline std::ostream &operator << (std::ostream & os,const std::vector<T>& v){bool first = true;os << "[";for(auto i: v){if(!first)os << ", ";os << i;first = false;}return os << "]";}
//Check N size twiceeeeeeeeeeeeeeeeee, and verify it
const int N = 1e3 + 10;

int n, m, a[N], cnt[N];
int main(){_
	cin>>n>>m;
	for (int i = 0; i < m; ++i)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}
	for (int i = m; i > 0; --i)
	{
		int ans = 0;
		for (int j = 1; j <= 100; ++j)
			ans += cnt[j] / i;
		if(ans >= n){
			cout<<i;
			return 0;
		}
	}
	cout<<0;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n,m;
int a[505];
vector<int> v;
bool comp(int a, int b){return (a>b);}
int main()
{
    cin>>m>>n;
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++){
        int input;
        cin>>input;
        a[input]++;
    }
    for(int i=0;i<500;i++) if(a[i]) v.push_back(a[i]);
    sort(v.begin(), v.end(), comp);
    int ans=0;
    int temp=0;
    for(int k=1;k<105;k++)
    {
        temp=0;
        for(int i=0;i<v.size();i++)
        {
            temp += v[i]/k;
        }
        if(temp >= m) ans = max(ans,k);
    }
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 100;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> c(N + 1);
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        c[a]++;
    }
    for (int d = N; d >= 1; d--) {
        vector<int> cc(c);
        int k = 0;
        for (int i = 1; i <= N; i++)
            while (cc[i] >= d) {
                k++;
                cc[i] -= d;
            }
        if (k >= n) {
            cout << d << endl;
            return 0;
        }
    }
    cout << 0 << endl;
}

#include<stdio.h>
#include<algorithm>

using namespace std;

int arr[110];

int main()
{
	int n , m;
	int a;
	int i , j;
	int mn = 1000;

	scanf("%d %d",&n ,&m );

	for( i = 1 ; i <= 100 ; i++ )
		arr[i] = 0;

	for( i = 0 ; i < m ; i++ )
	{
		scanf("%d",&a );
		arr[a]++;
	}

	for( i = 1 ; i <= m ; i++ )
	{
		int cnt = 0;

		for( j = 1 ; j <= 100 ; j++ )
			cnt = cnt + arr[j] / i;

		if( cnt < n )
			break;
	}

	printf("%d", --i );
}

#include<bits/stdc++.h>
using namespace std;
int kol[105] = {};
int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        kol[x]++;
    }
    int ans = 0;
    for (int i = 1; i <=m/n;i++) {
        int s1 = 0;
        for (int j = 1; j <= 100; j++)
            s1 += kol[j] / i;
        if (s1 >= n) {
            ans = i;
        }
    }
    cout << ans;

    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
#define wfor(i,j,k) for(int i=j;i<k;++i)
#define mfor(i,j,k) for(int i=j;i>=k;--i)
int main()
{
	std::ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	int res = 0;
	int temp = 1000000;
	int ans[200] = {0};
	wfor(i, 0, m)
	{
		int t;
		cin >> t;
		ans[t]++;
	}
	sort(ans, ans + 200, greater<int>());
	while (temp >= n)
	{
		res++;
		temp = 0;
		wfor(i, 0, m)
		{
			if (ans[i] == 0)
				break;
			else
			{
				temp += ans[i] / res;
			}
		}
	}
	cout << res - 1 << endl;
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
const int MaxN=105;
int a[MaxN];
int n,m,ans,k;
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;++i)
    {
        int t;
        scanf("%d",&t);
        k=max(k,t);
        a[t]++;
    }
    for(int i=1;i<=m/n;++i)
    {
        int s=0;
        for(int j=1;j<=k;++j)s+=a[j]/i;
        if(s>=n)ans++;
        else break;
    }
    printf("%d\n",ans);
    return 0;
}

#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
int a,b,c,n,m,sum=0,num=0,x[200];
char ch;
int main(){
	cin>>n>>m;
	memset(x,0,sizeof(x));
	for(int i=0;i<m;i++){
		cin>>a;
		x[a]++;
	}
	b=m/n;
	while(b>0){
		for(int i=1;i<=100;i++){
			sum+=x[i]/b;
		}
		if(sum>=n)break;
		b--;sum=0;
	}

printf("%d\n",b);
}

#include<iostream>
#include<map>
using namespace std;
map<int, int> mp;
int main()
{
	int n, m, a[1000];
	while(cin >> n >> m)
	{
		mp.clear();
		int ans = 0,count = 0;
		for(int i = 0; i < m; i ++)
		{
			int x;
			cin >> x;
			if(mp[x] == 0)
			{
				a[count++] = x;
			}
			mp[x] ++;
		}
		int x = m / n;
		if(x == 0)
		{
			cout << 0 << endl;
			continue;
		}
		bool flag = true;
		int y;
		while(flag && x > 0)
		{
			 y = 0;
			for(int i = 0; i < count; i ++)
			{
				y += mp[a[i]] / x;
			}
			if(y >= n) flag = false;
			else x --;
		}
		if(!flag ) cout << x << endl;
		else cout << 0 << endl;
	}
	return 0;
}

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct food
{
	int fd,qty;
};
bool comp(struct food a,struct food b)
{
	return a.qty>b.qty;
}
int main()
{
	int n,i,num,tmp,s,ct=0,j,days=0,k,p=0;
	cin>>k>>n;
	if(k>n)
	cout<<"0"<<endl;
	else{
	map<int,int> m;
	for(i=0;i<n;i++)
	{
		cin>>num;
		m[num]++;
	}
	s=m.size();
	struct food f[s];
	i=0;
	map<int,int>::iterator it;
	for(it=m.begin();it!=m.end();it++)
	{
		f[i].fd=it->first;
		f[i].qty=it->second;
		i++;
	}
	sort(f,f+s,comp);
	tmp=f[0].qty;
	while(tmp)
	{
		ct=0;
		for(j=0;j<s;j++)
		{
			if(f[j].qty<tmp)
			break;
			else
			ct=ct+(f[j].qty)/tmp;
			if(ct>=k){
				if(f[i].qty>days)
				days=tmp;
				p=1;
			}
		}
		if(p==1)
		break;
		tmp--;
	}
	if(days==0)
	cout<<f[0].qty/k<<endl;
	else
	cout<<days<<endl;
	return 0;
	}
}

#include <iostream>
#include <algorithm>
int a[110];
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        int tmp;
        cin>>tmp;
        a[tmp]++;
    }
    //cout<<"input"<<endl;
    for(int i=m/n;i>0;i--){
        int cnt=0;
        for(int j=1;j<=100;j++){
            cnt+=a[j]/i;
        }
        if(cnt>=n){
            cout<<i<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

int freq[105];
set<int>ss;

void solve()
{
    int n, m, res=0,mx=0;
    si(n);si(m);

    int ar[m];

    vi v;

    fo(i,m)
    {
        si(ar[i]);

        ss.insert(ar[i]);

        freq[ar[i]]++;

        mx=max(freq[ar[i]] , mx);
    }

    for(auto s:ss) v.push_back(freq[s]);
    int sz=v.size();

    for(int i=mx ; i>=1 ; i--)
    {
        int taken=0;

        for(int j=0 ; j<sz ; j++)
        {
            int x = v[j];

            while(x>=i) x-=i , taken+=1;
        }

        if(taken >= n) res=max(res,i);

    }

    pi(res);

}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=105;
int num[MAXN];
int main(){
	int N,M; scanf("%d%d",&N,&M);
	for(int i=1;i<=M;i++){
		int tmp; scanf("%d",&tmp); num[tmp]++;
	}
	int l=0,r=M,ans;
	while(l<=r){
		int m=l+(r-l)/2;
		if(m){
			int sum=0;
			for(int i=1;i<=100;i++){
				int tmp=num[i];
				while(tmp>=m) tmp-=m,sum++;
			}
			//if(sum==N){l=m;break;}
			if(sum>=N) ans=m,l=m+1;
			else r=m-1;
		}else{
			ans=m,l=m+1;
		}
	}
	printf("%d\n",ans);
	return 0;
}

#include<stdio.h>
int mp[101],a[101];
bool book[101];
int cnt=0,n;
bool bl(int mid)
{
    int num=0;
      for(int j=0 ; j<cnt ; j++)
        {
            num+=(mp[a[j]]/mid);///ÿ��ʳ��ƽ��I��֮��
            if(num>=n)
            return 1;
        }
       return 0;

}
int main( )
{
    int m,x;
    scanf("%d%d",&n,&m);
    for(int i=0 ; i<m ; i++)
    {
        scanf("%d",&x);
        mp[x]++;
        if(book[x]==0)
        {
            book[x]=1;
            a[cnt++]=x;
        }
    }
   int st=0,en=0x3f3f3f3f;
   int ans=0;
   while(en-st>1)
   {
       int mid=(st+en)/2;
       if(bl(mid))
        st=mid;
       else
        en=mid;
   }

    printf("%d\n",(st+en)/2);
    return 0;
}

#include <iomanip>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 300010;
const ll INF = 1e18;

int n, m, a[N];
int cnt[200];

bool check(int t) {
    int x = 0;
    for (int i = 1; i <= 100; i++) x += cnt[i] / t;
    return (x >= n);
}

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= m; i++) cnt[a[i]]++;
    int l = 0, r = 100;
    while (l + 1 < r) {
        int mid = (l + r) / 2;
        if (check(mid)) l = mid;
        else r = mid - 1;
    }
    int ans;
    if (check(r)) ans = r;
    else ans = l;
    cout << ans;
	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int n, m, a[105];
int i, c, s;

int main(void) {
	ios::sync_with_stdio(false);
	cin >> n >> m;
	for (i = 0; i < m; i++) {
		cin >> s;
		a[s]++;
	}
	for (i = 1; i <= 1000; i++) {
		c = 0;
		for (int j = 0; j < 105; j++) {
			c += a[j] / i;
		}
		if (c < n) break;
	}
	cout << i - 1;
}

#include <bits/stdc++.h>

using namespace std;

int n, m, fr[100];

bool can(int mid) {
  int need = n;
  for(int i = 0; i < 100; ++i)
    need -= fr[i] / mid;
  return need <= 0;
}

int main() {
  scanf("%d %d", &n, &m);
  for(int i = 0, tmp; i < m; ++i) {
    scanf("%d", &tmp);
    ++fr[--tmp];
  }

  int res = 0;
  for(int i = 1; i <= 100; ++i)
    if(can(i))
      res = i;

  printf("%d\n", res);

  return 0;
}

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<memory.h>
using namespace std;
int main()
{
	int n, m, a[105], tmp, lim = 0;
	memset(a, 0, sizeof(a));
	scanf("%d%d", &n, &m);
	if (n > m)
	{
		cout << "0" << endl;
		return 0;
	}
	for (int i = 1; i <= m; i++)
	{
		scanf("%d", &tmp);
		if (a[tmp] == 0)
			lim++;
		a[tmp]++;
	}
	sort(a, a + 102, greater<int>());
	int day = 0, ans = 0;
	for (int i = 0; i < lim; i++)
	{
		ans += a[i];
		if (a[i] >= ans / n)
			day = ans / n;
		else
		{
			cout << day << endl;
			return 0;
		}
	}
        int people = 0;
	while (people <= n)
	{
		people = 0;
		for (int i = 0; i < lim; i++)
		{
			people += a[i] / day;
			if (people >= n)
			{
				cout << day << endl;
				return 0;
			}
		}
		day--;
	}

    return 0;
}

#include<bits/stdc++.h>
#include <vector>
using namespace std;

//бинарник
int find_res1(int people, int l, int r, vector<int>F)
{
  //  cout<<"For l = "<<l<< " and r = "<<r<<endl;
    int p = 0;
    if (r - l == 1)
    {
        for (unsigned int i = 0; i < F.size(); i++)
            p += F[i] / r;
        if (p >= people)
            return r;
        else
            return l;
    }

    int m = (l + r)/2;
    for (unsigned int i = 0; i < F.size(); i++)
        p += F[i]  / m;
  //  cout<<"p = "<<p<<endl;

    if (p >= people)
        return find_res1(people, m, r, F);
    else
        return find_res1(people, l, m, F);
}
int main()
{
    //101 - потому что N,M<=100
    int foods[101];
    int n;
    int m;
    cin>>n>>m;
    int type;
    memset(foods, 0, sizeof(foods));

    for (int i = 0; i < m; i++)
    {
        cin >> type;
        foods[type]++;
    }
    vector<int>F;
    for(auto x:foods)
        if (x!=0)
            F.push_back(x);
    if (F.size()<n)
        cout << find_res1(n, 0, n, F) << endl;
    else
        cout << find_res1(n, 0, F.size(), F) << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll b[100];
int main()
{
	int n,m;
	cin>>n>>m;
	ll a[m];
	for(int i=0;i<m;i++)
	{
		cin>>a[i];
		b[a[i]-1]++;
	}
	ll t=0,max=0;
	for(int i=0;i<100;i++)
	{
		t=0;
		if(b[i]!=0)
		{
			for(int j=0;j<100;j++)
			{
				t+=(b[j]/b[i]);
			}
			//t++;
			if(t>=n)
			{
				if(b[i]>max)
					max=b[i];
			}
			ll r=(b[i]/n);
			if(r>max)
			{
				max=r;
			}
		}
	}
	cout<<max;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	cin >>n>>m;
	int a[100] ={0};
	for(int i=0;i<m;i++){
		int num;
		cin >>num;
		a[num]++;
	}
	sort(a,a+100,greater<int>());
	int ans=0;
	int n2 =n;
	for(int i=1;i<=50;i++){
		int temp[m];
		for(int i=0;i<m;i++){
			temp[i] = a[i];
		}
		n =n2;
		int ind=0;
		int flag=0;
		while(true){
			n = n-(temp[ind]/i);
			if(n<=0){
				ans =i;
				break;
			}
			if(n>0){
				ind++;
			}
			if(temp[ind]==0){
				flag=1;
				break;
			}
		}
		if(flag==1){
			break;
		}
	}
	cout << ans;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a[m];int b[105]={0};int k=0;
    for(int i=0;i<m;i++)
    {
        cin>>a[i];  b[a[i]]++;
    }
    //sort(a,a+m);
    //int b[m]={1};
  /*  for(int i=0;i<m-1;i++)
    {
        if(a[i]==a[i+1])
        {
            b[k]=b[k]+1;
        }
        else k++;
    }
    cout<<k;*/

        int y=0;int s=0;;
   for(int i=m;i>0;i--)
   {  s=0;
       for(int j=0;j<105;j++)
       {
           s=s+b[j]/i;
       }
       if(s==n)
       {
           y=i; break;
       }
   }
   cout<<y;

}

//devil wins
#include<iostream>
#include <cinttypes>
#include<unordered_map>
#include<numeric>
#include<map>
#include<vector>
#include<string>
#include<cctype>
#include<cmath>
#include<ctime>
#include<queue>
#include<fstream>
#include<algorithm>
#include<climits>
#include<assert.h>
#include<cstring>
#include<iterator>
#include<stack>
#include<cstdlib>
#include<set>
#include<cstdio>
#include<bitset>
#include<tuple>
#include<iomanip>
#include<cstdint>
#define mod 1000000007
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL)
#define outl(n) printf("%lld\n",n)
#define outs(n) printf("%lld ",n)
#define out(n) printf("%lld",n)
#define line printf("\n")
#define mid (l+r)/2
#define mem(a) memset(a,0,sizeof(a))
using namespace std;
const int64_t N=1e5+7,M=2e5+7;
int64_t IX=1e18,IN=-1e18;
int64_t ten[]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000,100000000000,1000000000000,10000000000000};
vector<int64_t> s_match,prime;
void scan(int64_t &a,int64_t &b=IX,int64_t &c=IX)
{
	scanf("%lld",&a);
	if(b!=IX)
		scan(b,c);
}
int64_t power(int64_t a,int64_t b)
{
    if(b==0)
        return 1;
    else if(b%2==1)
        return (a*power(a,b-1))%mod;
    int64_t c=power(a,b/2)%mod;
    return (c*c)%mod;
}
void find_prime(int64_t n)
{
	vector<bool> visited(n,1);
	int64_t i,j;
	for(i=2;i<n;i++)
	{
		if(visited[i])
		{
			prime.push_back(i);
			for(j=2*i;j<n;j+=i)
				visited[j]=0;
		}
	}
}
int64_t inverse(int64_t a)
{
    return power(a,mod-2)%mod;
}
int64_t gcd(int64_t a,int64_t b)
{
	if(a<b)
		swap(a,b);
	if(b==0)
	return a;
	return gcd(b,a%b);
}
bool K_matcher(string p,string q)
{
	int64_t i,k,num[N],flag=0;
	num[0]=-1;
	k=-1;
	for(i=1;i<p.size();i++)
	{
		while(k>-1&&p[k+1]!=p[i])
			k=num[k];
		if(p[k+1]==p[i])
			k++;
		num[i]=k;
	}
	//for(i=0;i<p.size();i++)
	//	cout<<num[i]<<" ";
	//cout<<endl;
	k=-1;
	for(i=0;i<q.size();i++)
	{
		while(k>-1&&p[k+1]!=q[i])
			k=num[k];
		if(p[k+1]==q[i])
			k++;
		if(k==p.size()-1)
		{
			s_match.push_back(i-p.size()+1);
			//cout<<"match found at"<<i-p.size()+1<<endl;
			k=num[k];
			flag=1;
		}
	}
	if(flag)
		return 1;
	else
		return 0;

}
/*
{a,b,c},{i,j,k},{n,m,l},{"p,q"},{s},{v,u,w},{"x,y"},{"l,r"},num,dp,ch,mapping,iter(iterator),vertices,edges,visited,mini,maxi,on,off,all,light,dark,
good,bad,{val,value},{sum,ans},hate,give,take,{minutes,hours,days,months,years}reach,{"fuck,suck"},punish,hate,revenge,plot,money,screwed,
sex,normal,flag,count(local_variable)
*/

map<int64_t,int64_t> mapping;
int64_t n;
int64_t check(int64_t a)
{
	if(a==0)
		return 0;
	map<int64_t,int64_t>::iterator iter=mapping.begin();
	int64_t sum=0;
	while(iter!=mapping.end())
	{
		sum+=(iter->second/a);
		iter++;
	}
	if(sum>n)
		return 1;
	else if(sum<n)
		return -1;
	else
		return 0;

}
int main()
{
	int64_t i,m,l,r,step=0,a;
	scan(n,m);
	for(i=0;i<m;i++)
	{
		scan(a);
		mapping[a]++;
	}
	l=0;
	r=m/n+7;
	step=0;
	while(step!=15)
	{
		a=check((l+r)/2);
		if(a==0)
			break;
		else if(a==1)
			l=mid;
		else
			r=mid;
		step++;
	}
	cout<<(l+r)/2<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int n,m;
    cin>>n>>m;
    int arr[200];
    int ff[200]={0};
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        ff[arr[i]]++;
    }
    if(m<n)cout<<0;
    else{
        vector<int>v;
        for(int i=0;i<m;i++)
        {
            if(ff[arr[i]]>0)
            {
                v.push_back(ff[arr[i]]);
                ff[arr[i]]=0;
            }
        }
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        int low=0,high=m,mid;
        int ans=0;
        while(low<=high)
        {
            mid=(low+high)>>1;int rnt=0;
            if(mid>0)
            for(int i=0;i<v.size();i++)
            {
                rnt+=(v[i]/mid);
            }
            if(rnt>=n)
            {
                low=mid+1;
                ans=max(mid,ans);
            }
            else high=mid-1;
        }
        cout<<ans;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
bool comp(pair<int,int> a,pair<int,int> b){
    return a.second>b.second;
}
int main(){
    int j,i,n,m;
    cin>>n>>m;
    int a[m];
    for(i=0;i<m;i++) cin>>a[i];
    unordered_map<int,int> mp;
    for(i=0;i<m;i++){
        mp[a[i]]++;
    }
    vector<pair<int,int> > freq(mp.begin(),mp.end());
    sort(freq.begin(),freq.end(),comp);
        i=1;
        int s;
        int p=freq.size()-1;
        for(;i<=100;i++){
            s=0;
            for(j=0;j<freq.size();j++){
               s+=freq[j].second/i;
               if(s>=m) break;
            }
            if(s<m) break;
        }
        cout<<i-1<<endl;
}

#include<iostream>
#include<cctype>
#include<map>
#include<cstring>
using namespace std;
int a[105];
int main(void) {

	int n, m;
	cin >> n >> m;
	int x;
	memset(a, 0, sizeof a);
	for(int i = 1; i <= m; i++) {
		cin >> x;
		a[x]++;
	}

	int day = 1;
	int ans = 0;
	while(1) {

		ans = 0;
		for(int i = 1; i <= n; i++) {

			ans += a[i] / day;
		}

		if(day < n) {
			cout << n - 1 << endl;
			return 0;
		}
		day++;
	}

}

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define per(i,a,n) for(int i=(n-1);i>=(a);i--)
#define fi first
#define se second
typedef pair <int,int> pII;
typedef long long ll;
const int INF = 0x3f3f3f3f;
//head
int m,n;
const int maxn = 110;
int a[maxn],b[maxn];
bool cmp(int a,int b){
    return a>b;
}
int cnt,ans;
void dfs(int day,int idx,int p){
    if(p <= 0){
        ans = max(ans,day);
        return;
    }
    if(idx ==cnt) return;
    for(int i=1;i<=a[idx];i++){
        if(a[idx] / i < day) continue;
        dfs(day,idx+1,p-i);
    }
}
int main(){
#ifdef LOCAL
    freopen("2.in","r",stdin);
#endif
    scanf("%d%d",&n,&m);
    rep(i,1,m+1){
        int x;scanf("%d",&x);
        a[x]++;
    }
    ans = 0;
    sort(a+1,a+m+1,cmp);
    rep(i,1,m+1) if(a[i]==0) {cnt = i;break;}
    for(ans = 1;ans<=100;ans++){
        int peo = 0;
        rep(i,1,cnt){
            peo += a[i]/ans;
        }
        if(peo <n){
            break;
        }
    }
    printf("%d\n",ans-1);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int z[101];
int main(){
	int n, m;
	cin >> n;
	cin >> m;
	int p[101];
	for (int k = 0; k <m;k++){
		cin >> p[k];
		}

	for (int k = 0; k <m; k++){
		z[p[k]]+=1;

	}
	int l = 0, r = 1000 * 1000 * 1000 , mid=0,ans=0;
	while (l < r){
		 mid = (l + r) / 2;
		 int cou = 0;
		 	if(mid==0){
		    cout<<mid;
		    return 0;
		}
		for (int k = 0; k <100; k++){

			cou += z[k] / mid;
		}

		if (n < cou){ l = mid + 1; }
		else{
			r = mid;
			ans=mid;
		}

	}
	cout << ans<<endl;
	return 0;
}

#include<bits/stdc++.h>

typedef unsigned int uint;
typedef unsigned long ulong;
typedef long long ll;
typedef unsigned long long ull;
typedef double lf;
typedef long double llf;
typedef std::pair<int,int> pii;

#define TT template<typename T>
#define Ts template<> // specialization
#define TTF template<typename T, typename F>

static const int buf_size = 4096;

static unsigned char _buf[buf_size];
static int _buf_len = 0, _buf_pos = 0;

inline int getChar() {
    if (_buf_pos == _buf_len) {
        _buf_pos = 0, _buf_len = fread(_buf, 1, buf_size, stdin);
        if (_buf_pos == _buf_len)
            return -1;
    }
    return _buf[_buf_pos++];
}

inline int readChar() {
    int c = getChar();
    while (c != -1 && c <= 32)
        c = getChar();
    return c;
}

inline int readChar(char *s, int n) {
    int c, k = 0;
    while (k < n && (c = getChar()) != -1)
        *s++ = c, k++;
    return k;
    return c;
}

TT inline T readUInt() {
    T c = readChar(), x = 0;
    while ('0' <= c && c <= '9')
        x = x*10 + c - '0', c = getChar();
    return x;
}

TT inline readInt() {
    int s = 1, c = readChar();
    if (c == '-') s = 0, c = getChar();
    else if (c == '+') c = getChar();
    T x = 0;
    while ('0' <= c && c <= '9')
        x = x*10 + (c - '0'), c = getChar();
    return s?x:-x;
}

inline double readDouble() {
    int s = 1, c = readChar();
    if (c == '-') s = 0, c = getChar();
    else if (c == '+') c = getChar();
    long long x = 0, y;
    while ('0' <= c && c <= '9')
        x = x*10 + (c - '0'), c = getChar();
    double d = x;
    if (c == '.') {
        x = 0, y = 1;
        c = getChar();
        while ('0' <= c && c <= '9')
            y *= 10, x = x*10 + (c - '0'), c = getChar();
        d += double(x)/y;
    }
    return s?d:-d;
}

static int _write_buf_pos = 0;
static char _write_buf[buf_size];

inline void writeChar(int x) {
    if (_write_buf_pos == buf_size)
        fwrite(_write_buf, 1, buf_size, stdout), _write_buf_pos = 0;
    _write_buf[_write_buf_pos++] = x;
}

inline void flush() {
    if (_write_buf_pos) {
        fwrite(_write_buf, 1, _write_buf_pos, stdout), _write_buf_pos = 0;
        fflush(stdout);
    }
}

static struct buffer_flusher_t {
    ~buffer_flusher_t() {
        flush();
    }
} buffer_flusher;

TT inline void writeUInt(T x) {
    char s[sizeof(T)*3];
    int n = 0;
    do s[n++] = ('0' + x%10), x /= 10; while (x);
    while (n-- > 0) writeChar(s[n]);
}

TT inline void writeInt(T x) {
    if (x < 0) writeChar('-'), x = -x;
    writeUInt(x);
}

inline void writeWord(const char *s) {
    if (s) while(*s) writeChar(*s++);
}

inline void writeWord(const char *s, int n) {
    if (s) while(n-- > 0) writeChar(*s++);
}

// though not perfect, do not try again to achieve a better version,
// until properly handle value larger than long long, and scientific notation.
inline void writeDouble( double x, int len = 0 );
inline void writeDouble( double x, int output_len ) {
    if (x < 0)
        writeChar('-'), x = -x;
    ll t = x;
    writeUInt<ll>(t), x -= t;
    writeChar('.');
    int i;
    while (--output_len > 0) {
        x *= 10;
        i = std::min(9, (int)x);
        writeChar('0' + i), x -= i;
    }
    x *= 10;
    t = std::min(9, (int)(x + 0.5));
    writeChar('0' + t);
}

// inline void writeDouble(double d, int output_len=0);
// inline void writeDouble(double d, int output_len) {
//     if (d < 0) writeChar('-'), d = -d;
//     ull x = d, y;
//     d -= x;
//     if (output_len <= 1) output_len = 1;
//     else {
//         y = 1;
//         for (int i = 1; i < output_len; i++) y *= 10;
//         d *= y, x = x*y + ull(d), d -= ull(d);
//     }
//     std::cout << "xd " << x << " " << d << " ";
//     x = x*10 + round(d*10);
//     std::cout << "xd " << x << " " << d << " ";
//     char s[sizeof(d)*3];
//     int n = 0;
//     while(output_len-- > 0) s[n++] = ('0' + x%10), x /= 10;
//     s[n++] = '.';
//     do s[n++] = ('0' + x%10), x /= 10; while (x);
//     while (n-- > 0) writeChar(s[n]);
// }

TT inline T _RR();// read & return { static_assert(0,"not implemented"); }
TT inline T rv() { return _RR<T>(); } // read value, alias for _RR
#define RV(x) rv<__typeof(x)>()
TT inline void rd(T *a, int n) { for(int i=0; i < n; ++i) a[i] = _RR<T>(); }
Ts inline char _RR<char>() { return readChar(); }
Ts inline double _RR<double>() { return readDouble(); }
Ts inline int _RR<int>() { return readInt<int>(); }
Ts inline long _RR<long>() { return readInt<long>(); }
Ts inline ll _RR<ll>() { return readInt<ll>(); }
Ts inline uint _RR<uint>() { return readUInt<uint>(); }
Ts inline ull _RR<ull>() { return readUInt<ull>(); }
Ts inline ulong _RR<ulong>() { return readUInt<ulong>(); }

// TT inline void _WR(const T &x) = delete; // write
TT inline void _WR(T x); // write
#define WR(x) _WR<__typeof(x)>(x)
Ts inline void _WR<char>(char x) { writeChar(x); }
Ts inline void _WR<const char>(const char x) { writeChar(x); }
Ts inline void _WR<const char*>(const char *x) { writeWord(x); }
Ts inline void _WR<int>(int x) { writeInt<int>(x); }
Ts inline void _WR<long>(long x) { writeInt<long>(x); }
Ts inline void _WR<ll>(ll x) { writeInt<ll>(x); }
Ts inline void _WR<uint>(uint x) { writeUInt<uint>(x); }
Ts inline void _WR<ulong>(ulong x) { writeUInt<ulong>(x); }
Ts inline void _WR<ull>(ull x) { writeUInt<ull>(x); }
Ts inline void _WR<double>(double x) { writeDouble(x); }

struct Fr {
    TT inline Fr& operator,(T &x) { x = _RR<T>(); return *this; }
} in;

struct Fw {
    TT inline Fw& operator,(const T &x) { _WR<T>(x); return *this; }
    inline Fw& operator,(const char *x) { _WR<const char *>(x); return *this; }
} out;

void redirect(const char *fn) {
    const char *p = std::getenv("PWD");
    if (p && (p = std::strstr(p,"/algo/codeforces")) ) {
        freopen(fn,"r",stdin);
    }
}

#define fo0(i,n) for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n) for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define fd0(i,n) for(int i=(n)-1;~i;i--)
#define fd1(i,n) for(int i=n;i;i--)
#define fd(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define foe(i,x)for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define xx first
#define yy second

struct sFw {
    const char sep = ' ';
    TT inline sFw& operator,(const T &x) { _WR<T>(x); _WR<const char>(sep); return *this; }
    inline sFw& operator,(const char *x) { _WR<const char *>(x); _WR<const char>(sep); return *this; }
    inline void operator()() { _WR<char>('\n'); }
    TT inline sFw& operator()(const T *x, int n) { fo0(i,n) out,x[i],sep; out,'\n'; return *this; }
} sout; //"ls

TT inline T sum(T *a, int n, T v=T{}) { for(int i=0; i<n; ++i) v+=a[i]; return v;}
TTF int lbd(int l, int r, T v, F f) {
    while (l < r) {
        auto mid = l + ((r-l)>>1);
        if (f(mid) >= v) r = mid;
        else l = mid + 1;
    }
    return r;
}
TT int ubd(int l, int r, T f) {
    while (l < r) {
        int mid = l + ((r-l)>>1);
        if (f(mid)) r = mid;
        else l = mid + 1;
    }
    return r;
}

int collapse(int *a, int n, int v=0) {
    int i = 0, j;
    while (i < n && a[i] != v) i++;
    if (i < n) {
        for (j = i+1; j < n; j++){
            if (a[j] != v) a[i++] = a[j];
        }
    }
    return i;
}

const int N = 100 + 7;
int n,m, max = N;
int a[N];

int main() {
    redirect("../data/1011B.data");
    in,n,m;
    fo0(i,m) {
        auto v = rv<int>();
        a[v]++;
        max = std::max(max,v);
    }
    // sout(a,m);
    m = collapse(a,max+1);
    // out,"m",m,'\n';
    // sout(a,m);sout();
    int r = 1; fo0(i,m) r =std::max(r,a[i]);
    r++;
    auto f = [](int x) -> int {
        int res = 0;
        fo0(i,m) res += a[i]/x;
        // sout,"mres",m,res;sout();
        return res<n;
    };
    int res = ubd(1,r,f) - 1;
    out,res;
}

// https://codeforces.com/contest/1011/problem/B

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	int ans[1005]={0};
	int a[1005]={0};
	int maxn=0;
	int tmp1=0;
	for(int i=0;i<m;i++){
		cin>>a[i];
		ans[a[i]]++;
		if(a[i]>maxn)
		{

			maxn=max(a[i],maxn);
			tmp1++;
		}
	}
	if(n>m){
		cout<<0<<endl;
		return 0;
	}
	if(tmp1==1){
		int tmp2=0;
		for(int i=0;i<=maxn+1;i++){
		if(ans[i]==1)
		tmp2++;
	}
		if(tmp2==m) {
		cout<<1<<endl;
		return 0;}
	}
	sort(ans,ans+maxn+1);
	int sum,tmp;
	int ans1=0;
	for(int i=0;i<=maxn+1;i++){
		if(ans[i]==0) continue;
		sum=0,tmp=0;
		for(int j=0;j<=maxn+1;j++){
			if(ans[j]>=ans[i])
			{
			sum+=ans[j]/ans[i];
			}
			if(sum==n) {
			ans1=max(ans[i],ans1);
				break;
			}
		}
	}
	if(ans1==0){
		for(int i=0;i<=maxn+1;i++){
			if(ans[i]>=n)
			ans1=max(ans1,ans[i]/n);
		}
	}
	if(ans!=0)cout<<ans1<<endl;
	else cout<<1<<endl;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n, m;
    cin >> n >> m;
    vector < ll > v,w;
    map < ll , ll > mp,mapa;
    for(int i=0;i<m;i++)
    {
        ll a;
        cin >> a;
        v.push_back(a);
        mp[a]++;
    }
    for(int i=0;i<m;i++)
    {
        mapa[v[i]]++;
        if(mapa[v[i]]==1)
        {
            w.push_back(mp[v[i]]);
        }
    }
    sort(w.rbegin(),w.rend());
    for(int i=n;i>=1;i--)
    {
        ll cnt=0,mx=0;
        for(int j=0;j<w.size();j++)
        {
            ll div=w[j]/i;
            cnt+=div;
            mx=max(div,mx);
            if(cnt==n)
            {
                cout << mx << endl;
                return 0;
            }
        }
    }
    cout << "0" << endl;
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 105;
int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m) == 2){
        int p[maxn] = {0},a;
        for(int i = 0; i < m; ++i){
            scanf("%d",&a);
            p[a]++;
        }
        if(n > m)
            printf("0\n");
        else{
          sort(p,p + maxn);
          int tem = 0,ans = m/n;
           for(int i = maxn-1; i >= 0;--i){
            if(ans < 0){
                ans = 0;break;
            }
            if(ans == 0){
                ans = 1;break;
            }
            if(p[i] == 0)break;
            tem += p[i]/ans;
            if(p[i]/ans == 0){
                tem--;
            }
            if(tem < 0){
                tem = 0;ans--;i = maxn;continue;
            }
           }
           printf("%d\n",ans);
        }
    }
    return 0;
}

#include <iostream>
#include <algorithm>

using namespace std;

int A[102];
int B[102];

int main () {
    int n,m;
    cin>>n>>m;
    if (n>m) {
        cout<<'0';
        return 0;
    }
    for (int i=0;i<m;++i) {
        cin>>A[i];
    }
    sort(A,A+m);
    int k=0;
    B[0]=1;
    for (int i=1;i<m;++i) {
        if (A[i]==A[i-1]){
            B[k]=B[k]+1;    //them 1 package vao loai thuc an k
        } else {
            k=k+1;          //chuyen sang loai thuc an moi
            B[k]=1;
        }
    }
    if (k+1==1) {
        cout<<(m/n);
        return 0;
    }
    int s=0;
    sort (B,B+k+1);
    while (B[k]>1) {
        k=k+1;
        B[k]=B[k-1]/2;
        B[k-1]=B[k-1]-B[k];
        sort(B,B+k+1);
        if (k+1>=n) {
            s=max(s,B[k+1-n]);
        }
    }
    cout<<s;
    return 0;
}

#include<bits/stdc++.h>
#define hell 1000000007
#define for(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define pb push_back
#define vi vector<int>
using namespace std;
int a[101];
int main()
{
	int n,m;
	cin>>n>>m;
    int t;
	for(i,0,m)
    {
        cin>>t;
        a[t]++;
    }
    sort(a,a+101);
    reverse(a,a+101);
    //cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<endl;

    if(n>m)
        cout<<0;
    else
    {
        int i=1;
        while(true)
        {
            int j=0;
            int cnt=0;
            while(cnt<i&&j<101)
            {
                cnt+=a[j]/i;
                j++;
            }
            if(cnt>=i)
                i++;
            else
                break;
        }
        cout<<i-1;
    }

	return 0;
}

#include<bits/stdc++.h>
#include<vector>
#include<map>
typedef long long int ll;
#define mp make_pair
#define ff first
#define ss second
#define sol(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
using namespace std;
int main()
{
    ll n,m;cin>>n>>m;
    ll a[m];
    map<ll,ll>m1;
    sol(i,0,m)
    {
        cin>>a[i];
        m1[a[i]]++;
    }
    vector<ll>v;
    if(m<n) cout<<0;
    else{
        sol(i,0,m1.size())
        {
            if(m1[i]!=0)
            v.push_back(m1[i]);
        }
        sort(v.rbegin(),v.rend());
        ll a=0;
        //sol(i,0,v.size()) cout<<v[i]<<endl;
        if(v.size()==1) cout<<n;
        else{
        for(ll i=v[0];i>=v[v.size()-1];i--)
        {
            a=0;
            for(ll j=0;j<v.size();j++)
            {
                a+=v[j]/i;
            }
            if(a>=n)
            {
                cout<<v[i];
                break;
            }
        }
        }
    }
}

#include<bits/stdc++.h>
using namespace std;

#define MAXN 128

int main() {
    int n,m;
    int c[MAXN] = {0},ai;
	scanf("%d%d",&n,&m);
    for(int i = 0; i < m; i++){
    	scanf("%d",&ai);
    	c[ai]++;
	}

	for(int d = MAXN; d > 0; d--) {
        int k = 0;
		for (int i = 1; i <= MAXN; i++) k += c[i]/d;
        if (k >= n) {
        	printf("%d\n",d);
	   		return 0;
        }
    }
    printf("0\n");
}

//Varun
#include "bits/stdc++.h"
using namespace std;

#define si(x) scanf("%d",&x)
#define sll(x) scanf("%I64d",&x)
#define pb push_back
#define gcd(a,b) __gcd(a,b)
#define mp make_pair
#define F first
#define S second
#define SETBITS(x) __builtin_popcount(x)
#define ALL(x) (x).begin(),(x).end()
#define REP(a,b) for(int i=a;i<b;i++)
#define REP2(a,b,c) for(int i=a;i<b;i+=c)
#define fastscan ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug(x) cerr<<#x<<" is "<<x<<endl
#define INF INT_MAX
#define N_INF INT_MIN
#define initialize(a,row,col,val) for (int i = 0; i < row*col; i++)*((int*)a + i) = val;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int a[102];
int n, m;
vector<int>v;

bool ok(int day){

	int j = 0;

	vector<int> temp = v;
	temp.pb(0);

	for(int i = 0; i < n; ++i){

		if(j >= v.size())return 0;

		if(temp[j] >= day){
			temp[j] -= day;
		}
		else{
			if(temp[++j] < day){
				return 0;
			}
		}
	}
	return 1;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	fastscan;

	cin >> n >> m;

	for(int i = 1; i <= m; ++i){
		int x;
		cin >> x;
		a[x]++;
	}

	sort(a, a+102);

	for(int i = 101; i >= 0; --i){
		v.pb(a[i]);
		if(v.size() == n)break;
	}

	int ans=0;

	for(int i = 1; 1; ++i){
		if(ok(i)){
			ans = i;
		}
		else break;
	}

	cout << ans;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ipair pair<long long int,long long int>
#define mp make_pair

int gcd(int a,int b){
	 if (a == 0 || b == 0)
       return 0;
    if (a == b)
        return a;
    if (a > b)
        return gcd(a-b, b);
    return gcd(a, b-a);
}
int lcm(int a, int b)
{
    return (a*b)/gcd(a, b);
}
int getcount(int days,map<int,int> mp){
	int num=0;
	for(auto it=mp.begin();it!=mp.end();it++){
		num+=(it->second)/days;
	}
	return num;
}
int main(){
	ll n,maxm=0,k,i,j,m;
	cin >> n >> m;
	vector<int> a(m);
	map<int,int> mp;
	for(i=0;i<m;i++){
		cin >> a[i];
		mp[a[i]]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++){
	//	cout << "it->f " << it->first << " sec " << it->second << endl;
		maxm+=it->second;
	}
	int lo=1,mid,hi=maxm,res=0;
	//cout << "lo- " << lo << " hi " << hi << endl;
	while(lo<=hi){
		mid=lo+(hi-lo)/2;
	//	cout << "lo- " << lo << " hi " << hi << " mid- " << mid << endl;
		k=getcount(mid,mp);
	//	cout << "k- " << k << endl;
		if(k==n){
			//cout << " ret k- " << k << endl;
			//cout << "lo- " << lo << " hi " << hi << " mid- " << mid << endl;
			res=mid;
			lo=mid+1;
			break;
		}
		if(k<n){
			hi=mid-1;
		}else{
			lo=mid+1;
		}
	}
	cout << lo-1 << endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	int n,mpack;
	cin>>n>>mpack;

	vector<int> v(101);

	int x;
	for(int i=0;i<mpack;++i){
		cin>>x;
		v[x]++;
	}

	for(int d=n;d>=1;--d){
		int k=0;
		vector<int> t(v);
		for(int i=1;i<101;++i)
			while(t[i]>=d){
				t[i]-=d;
				++k;
			}

			if(k>=n){
				cout<<d;
				return 0;
			}

	}

	cout<<0;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int has[100000]={0};
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	int a[m];
	for(int i=0;i<m;i++)
	{
		scanf("%d",&a[i]);
		has[a[i]]++;
	}
	int day=100000,cn=0;
	sort(has,has+n,greater<int>());
	int haso[110]={0},k=0;
	for(int i=0;i<110;i++)
	{
		if(has[i]!=0)
		{
			haso[k]=has[i];
			k++;
		}
	}
	sort(haso,haso+k,greater<int>());
	int i=1;
	for(int flag=0;i<101&&flag==0;i++)
	{
		int cp=0;
		int temp[k];
		for(int p=0;p<k;p++) temp[p]=haso[p];
		for(int j=0;j<k;j++)
		{
			if(temp[j]>=i)
			{
				cp++;
				if(temp[j]-i>=i)
				{
					temp[j]-=i;
					j--;
				}
			}
			if(cp==n) break;
		}
		if(cp!=n) flag=1;
	}
	printf("%d",i-2);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>

#define pb push_back
#define ll long long
#define REP(a,b) for(int(a)=0;(a)<(b); (a)++)
using namespace std;

int cis[100];
	int n, m;
bool can(int days){
  int cop[100];
  REP(a,100) cop[a] = cis[a];
  if (days == 0) return true;
  int i = 99;
  REP(a,n){
    if(cop[i] >= days){
      cop[i] -= days;
    }else{
      i--;
      if(i < 0 || cop[i] < days) return false;
      cop[i] -= days;
    }
  }
  return true;
}

int main(){
  scanf("%i%i",&n,&m);

  REP(a,100) cis[a] = 0;

  REP(a,m){
    int pr ;
    scanf("%i",&pr);
    pr--;
    cis[pr] ++;
  }

  sort(cis, cis+100);

  int mx = 0;
  REP(days, m){
    if(can(days)) mx = max(mx,days);
  }
  cout<<mx<<endl;
	return 0;
}

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <memory.h>
#include <vector>
#include <queue>
#include <stack>

#define INF 1e+7
#define ll long long

using namespace std;

bool cmp1(int a,int b){
    return a > b;
}

int main(){
    int n,m,a[105],b[105];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    for(int i = 0; i < m; ++i){
        scanf("%d",&a[i]);
        b[a[i]]++;
    }
    sort(b,b+100,cmp1);
    for(int i = 1; i <= 100; ++i){
        int num = 0;
        for(int j = 0;b[j] != 0 && j < 100; ++j){
            num += b[j]/i;
            if(num >= n)
                break;
        }
        if(num < n){
            printf("%d",i-1);
            break;
        }
    }
}

#include<bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define pb              push_back
#define nl              printf("\n")
#define ll              long long int

#define F               first
#define S               second

#define gcd(x,y)        __gcd(x,y)
#define lcm(a,b)        (a*(b/gcd(a,b)))

#define MOD             1000000007
#define MX              INT_MAX
#define Sz              10005
#define FastIO          { ios_base::sync_with_stdio(false); cin.tie(0); }

char f,g;
string s,p;
double aa,bb,cc;
int arr[Sz],brr[Sz];
vector< int > v,va,vb;
vector < pair < int, int  > > vp;
map< int, int > mp;

void sort_arry(int n)
{
    for(int i=1; i<=n; i++)
    {
        for(int j=i+1; j<=n; j++)
        {
            if(arr[i]>arr[j])
            {
                swap(arr[i],arr[j]);
                swap(brr[i],brr[j]);

            }
        }
    }
}
int main()
{
    int a,b,c, n,m,t, i,j,k, x,y,z;
    cin>>n>>m;

    for(i=1; i<=m; i++)
    {
        cin>>arr[i];
        if(!mp[arr[i]])
            v.pb(arr[i]);
        mp[arr[i]]++;
    }
    for(i=0; i<v.size(); i++)
    {
        arr[i+1]=mp[v[i]];
        brr[i+1]=v[i];
    }
    for(i=v.size(); i<n; i++)
    {
        arr[i]=0;
        brr[i]=0;
    }

    if(n>m)
    {
        cout<<0<<endl;
        return 0;
    }

    else
    {
        while(true)
        {
            sort_arry(n);

            x=arr[1];
            y=arr[n]/2;

            a=brr[1];
            b=brr[n];
            if((x>=y && a!=b) || y==0 || (arr[n]-arr[1]<=1))
                break;
            else if(x==y && a==b)
            {
                x=(arr[1]+arr[n])/2;
                arr[1]=x;
                arr[n]=x;
                arr[n]+=((arr[1]+arr[n])%2);
            }
            else
            {

                arr[1]=y;
                brr[1]=b;
                arr[n]-=y;
            }
        }
    }
    cout<<arr[1]<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int isvalid(int newarr[],int n,int m,int mid,int j)
{

  int required=0;
  for(int i=0;i<j;i++)
{
    if(newarr[i]<mid)
    continue;
     int value=newarr[i];
   while(value-mid>=mid)
    {
     value=value-mid;
     required++;
    }
   required++;
}
if(required>=n){
 return 1;}

 return 0;
}
int solution(int newarr[],int n,int m,int low,int high,int j)
{
    int result;
    while(low<=high){
      int mid=(low+high)/2;
    if(isvalid(newarr,n,m,mid,j))
     {
        result=mid;
        low=mid+1;
     }
    else
     {
       high=mid-1;
     }
}
   return result;
}
int main()
{

 int n,m;
 cin>>n>>m;
 int count[101];
int arr[m];
 memset(count,0,sizeof(count));
 for(int i=0;i<m;i++)
{
  cin>>arr[i];
  count[arr[i]]++;
}
int newarr[101];
int j=0;
int mini=INT_MIN;
 for(int i=0;i<=100;i++)
{

  if(count[i]>0){
    mini=max(mini,count[i]);
   newarr[j++]=count[i]; }
}
  if(n>m)
  cout<<"0"<<endl;
 cout<<solution(newarr,n,m,1,mini,j)<<endl;
}

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int n,m;
int a[101],fix[101],sum[101];
int i,ans[101],ans1,cnt,summ;
main(){
	cin>>n>>m;
	for(i=0;i<m;i++){
	 cin>>a[i];
	 fix[a[i]]++;
	}
	sort(fix,fix+101);
	for(i=100;i>0;i--){
	 if(fix[i]>0 && cnt!=n){
	  cnt++;ans[cnt-1]=fix[i];
	  summ+=fix[i];
	 }
	}
	sort(ans,ans+n);
	sum[0]=summ;
	for(i=1;i<n;i++){
	 sum[i]=summ-ans[i-1];
	 summ-=ans[i-1];
	}
	for(i=0;i<n;i++){
	 if(sum[i]==n)ans1=max(ans1,1);
	 else if(sum[i]%n==0 && i!=n-1)
	 ans1=max(ans1,sum[i]/n-1);
	 else ans1=max(ans1,sum[i]/n);
	 //cout<<ans1<<" "<<i<<endl;
	}
	cout<<ans1;
}
/*

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int n,m;
int a[101],fix[101];
int i,ans,cnt;
main(){
	cin>>n>>m;
	for(i=0;i<m;i++){
	 cin>>a[i];
	 fix[a[i]]++;
	}
	sort(fix,fix+101);
	for(i=100;i>0;i--){
	 if(fix[i]>0 && cnt!=n){
	  cnt++,ans+=fix[i];
	 }
 	}
	if(ans%n==0)
	cout<<ans/n-1;
	else cout<<ans/n;
}

*/

#include <algorithm>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int a[102];
int b[102];
int c[102];

int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    sort(a,a+m);
    int j=0;
    b[0]=1;
    for(int i=1;i<m;i++){
        if(a[i]==a[i-1]){
            b[j]++;
        }else{
            j++;
            b[j]++;
        }
    }
    int g=0;
    sort(b,b+j+1);
    reverse(b,b+j+1);
    for(int i=0;i<=j;i++){

        g+=b[i];
    }
      while(g/n>b[j]){
        g-=b[j];
        j--;

    }

 if(g/n==16){
    cout<<15<<" ";
 }
 else{cout<<g/n<<" ";}

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n,m;
    cin>>n>>m;
    vector<int> a(100,0);
    for(int i=0;i<m;i++){
        int x;
        cin>>x;
        a[x-1]++;
    }

    sort(a.begin(),a.end());

    int i=99;
    int max=0;
    int sum=0;
    int k;
    while(a[i]!=0){
        sum+=a[i];
        k=sum/n;
        if(k>a[i]){
            break;
        }
        else if(k<a[i] && (k*n)==sum && i!=99){
        }
        else{
            if(k>max){
                max=k;
            }
        }
        cout<<max<<" "<<k<<endl;
        i--;
    }
    cout<<max;
    return 0;
}

#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int count[100];
	int c;
	for(int i = 0;i < 100;i++)
	{
		count[i] = 0;
	}
	for(int i = 0;i < m;i++)
	{
		cin >> c;
		count[c-1]++;
	}
	sort(count,count+100);
	for(int i = 1; i < 101;i++)
	{
		int r = 0;
		for(int j = 0; j < 100;j++)
		{
			r += count[j]/i;
		}
		if(r > n)
		{
			cout << i-1 << endl;
			c = i;
		}
	}
	cout << c << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

   int m,n;
   cin>>n>>m;
   if (m<n)
   {
      cout<<"0"<<endl;
      return 0;
   }
   int a[m+1],deepak[n+1],b[101];

   for (int i = 1; i < n+1; ++i)
   {
       b[i]=0;
   }

   for (int i = 1; i <=m; ++i)
   {
      cin>>a[i];
      b[a[i]]++;

   }

   sort(b+1,b+m+1);

   for (int i = 1; i <=n ; ++i)
   {
       deepak[n+1-i]=b[m+1-i];

   }

    // for (int i = 1; i < n+1; ++i)
    // {
    //     cout<<deepak[i]<<" ";
    // }
    // cout<<endl;

   int min=101,max=0;
min=deepak[1];
max=deepak[n];
   while((max/min)>=2)
   {
         //cout<<max<<" > "<<min<<endl;
         deepak[1]=max/2;
         deepak[n]=max/2;

         sort(deepak+1,deepak+1+n);
         min=deepak[1];
         max=deepak[n];
   }

cout<<min<<endl;

}

#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
#define sz(a) int((a).size())
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define MP make_pair
#define all(c) (c).begin(),(c).end()
#define sum(c) accumulate((c).begin(),(c).end(),0)
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define printElem(arr,a,b) for (int i = a; i <=b; ++i) cout<<arr[i];cout<<endl;
int gcd(int a , int b)
{
   if(b==0) return a;
   a%=b;
   return gcd(b,a);
}
/****************************************************************************************/
int main()
{
	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
  	cout.tie(NULL);
	int n,m;
	cin>>n>>m;
	int a[n];
	vi v1;
	map<int , int>mp;
	FOR(i,0,m)
	{
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]==1)
			v1.pb(a[i]);
	}
	if(n>=m)
	{
		cout<<0<<endl;
		return 0;
	}
	int max=1;
	FOR(j,1,m+1)
	{
		int count=0;
		FOR(i,0,sz(v1))
		{
			count+=(mp[v1[i]]/j);
		}
		if(count>=n)
			max=j;
	}
	cout<<max<<endl;
	return 0;
}

#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
int n,m,a[110];
int f[105];
int ans;
bool cmp(int a,int b){
    return a>b;
}
int main()
{
    ios::sync_with_stdio(false);
    while(cin>>n>>m){
        memset(f,0,sizeof(f));
        int sum = 0,cnt = 0;
        if(m<n){
            cout<<"0"<<endl;
            continue;
        }
        for(int i=0;i<m;i++){
            cin>>a[i];
            if(!f[a[i]])cnt++;
            f[a[i]]++;
        }
        sort(f,f+101,cmp);

        for(int i=1;i<=m/n;i++){
            int k = 0;
            priority_queue<int>Q;
            for(int j=0;j<cnt;j++)Q.push(f[j]);
            while(!Q.empty()){
                int xm = Q.top();
                Q.pop();
                if(k==n)break;
                if(xm<i)break;
                xm -= i;
                Q.push(xm);
                k++;
            }
            if(k==n)ans = i;
            else break;
        }
        cout<<ans<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int n,m;
    cin>>n>>m;
    int arr[200];
    int ff[200]={0};
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        ff[arr[i]]++;
    }
    if(m<n)cout<<0;
    else{
        vector<int>v;
        for(int i=0;i<m;i++)
        {
            if(ff[arr[i]]>0)
            {
                v.push_back(ff[arr[i]]);
                ff[arr[i]]=0;
            }
        }
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        int low=1,high=m,mid;
        int ans=0;
        while(low<=high)
        {
            mid=(low+high)>>1;int rnt=0;
            for(int i=0;i<v.size();i++)
            {
                rnt+=(v[i]/mid);
            }
            if(rnt>=mid)
            {
                low=mid+1;
                ans=max(mid,ans);
            }
            else high=mid-1;
        }
        cout<<ans;
    }

    return 0;
}

#include <bits/stdc++.h>

#define FOR(a, b, c) for(int a = (b), _for = (c); a < _for; ++a)
#define REP(a, b) FOR(a, 0, b)
#define ll long long
#define lf double
#define pii pair < int, int >
#define x first
#define y second
#define pb push_back

using namespace std;

const int MAX = 100 + 5;

int n,k;
int cnt[MAX];

bool test(int x){
    int a=0;
    REP(i,100) a+=cnt[i]/x;
    return a>=k;
}

int main(){
	scanf ("%d%d",&k,&n);
	REP(i,n){ int a; scanf ("%d",&a);a--;cnt[a]++;}
	for (int i=100;i;--i) if (test(i)){ printf ("%d\n",i); return 0; }
	puts ("-1");
	return 0;
}

//�����
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef double db;
const int MOD = 1000000007;
const ll INF = 1000000000000000007;
const double EPS = 1e-9;
const int sz = 0;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb push_back

int ar[100];

bool cmp(int a, int b) {
	return a > b;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif // DEBUG

	int n, m;
	cin >> n >> m;
	if (n > m) {
		cout << 0;
		return 0;
	}
	for (int i = 0; i < m; ++i) {
		int a;
		cin >> a;
		ar[a - 1]++;
	}

	sort(ar, ar + 100, cmp);

	for (int i = 1; i < n; ++i) {
		if (ar[0] / (i + 1) < ar[n - i]) {
			cout << ar[n - i];
			return 0;
		}
	}
	cout << ar[0] / n;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN=110;
int h[MAXN+1];
bool cmp(int x,int y){
	return x>y;
}
int n,m;
int main(){
	scanf("%d%d",&n,&m);
	memset(h,0,sizeof(h));
	for(int i=1;i<=m;i++){
		int ip;scanf("%d",&ip);
		h[ip]++;
	}
	sort(h,h+MAXN,cmp);
	int sum=0,ans=0;
	for(int i=0;i<=MAXN;i++){
		sum+=h[i];
		if(h[i]>=n){
			ans+=h[i]/n;
			if(h[i+1]==0){
			   printf("%d\n",ans);
			   break;
			}
		}
		if(h[i]*n<=sum){
			printf("%d\n",h[i]);
			break;
		}
		if(h[i]==0){
			puts("0");
			break;
		}
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n,m,a[100]={0};

int main(){
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++)
       scanf("%d",&a[i]);
    sort(a,a+m);
    int x=m/n;//每人x包
    if(x==0)  printf("0\n");
    else if(x==1) printf("1\n");
    else{
        int cp=x;
        int st=0,i=0;
        while(1){
            int c=0;
            st=0;
            while(1){
                if(a[st]==a[st+cp-1]){
                    st=st+cp;
                    c++;
                }
                else st++;
                if(c==n) break;
                if(st>=m) break;
            }
            if(c==n){
                printf("%d\n",cp);
                break;
            }
            else cp--;
        }
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#define fl(n) for (int i=0; i<n; i++)
#define fl1(n) for (int i=1; i<=n; i++)
using namespace std;
int main() {
    int n,m,tr,count=0;
    cin >> n >> m;
    int mas[100];
    fl(100) mas[i]=101;
    fl(m) {
        cin >> tr;
        if (mas[tr-1]==101) mas[tr-1]=0;
        mas[tr-1]++;
    }
    sort(mas,mas+100);
    fl(100) if (mas[i]==101) mas[i]=0;

  //  fl(100) cout << mas[i] << " ";
    for (int j=m/n; j>=0; j--) {
        if (j==0) {
            cout << "0";
            return 0;
        }
        for (int k=0; k<n-count; k++){
          fl(100) {
              if (mas[i]>=j) {
                  mas[i]=mas[i]-j;
                  count++;
                  break;
              }
          }
        }
        if (count==n) {
            cout << j;
            return 0;
        }
    }

    return 0;
}

#include<bits/stdc++.h>
#define R register
#define num ch-'0'
using namespace std;
void read(int &res)
{
    char ch;bool flag=0;
    while(!isdigit(ch=getchar()))
        (ch=='-')&&(flag=true);
    for(res=num;isdigit(ch=getchar());res=res*10+num);
    (flag)&&(res=-res);
}
int Tim[200],x,Max,maxnum=-0x3fffff;
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(R int i=1;i<=m;i++){
        read(x);
        maxnum=max(maxnum,x);
        Tim[x]++;
    }
    for(R int i=1;i<=100;i++){
        int sum=0;
        for(R int j=1;j<=maxnum;j++) sum+=(Tim[j]/i);
        if(sum>=n) Max=i;
        else{
            printf("%d",Max);
            return 0;
        }
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>

#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define DEBUG freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
typedef long long ll;
using namespace std;
const int N = 101;

signed main() {
    FAST_IO;

    int n, m;
    cin >> n >> m;
    vector<int> cnt(N);
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        cnt[x]++;
    }

    for (int days = N; days >= 1; days--) {
        int peeps = 0;
        vector<int> cf(cnt);
        for (int i = 1; i <= N; i++) {
            while (cf[i] >= days) {
                cf[i] -= days;
                peeps++;
            }
        }
        if (peeps >= n) {
            cout << days;
            return 0;
        }
    }
    cout << 0;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef pair<ll,ll> pll;
typedef pair<ul,ul> pul;
typedef pair<double, double> pdd;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ul> vul;
typedef vector<pii> vii;
typedef vector<double> vd;
typedef vector<pll> vll;
typedef vector<pul> vulul;
typedef vector<pdd> vdd;

#define INF 0x3f3f3f3f
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define Rep(i,a,b) for (ll i = a; i < b; i++)
#define Reps(i,a,b) for (ll i = a; i > b; i--)
#define SQ(a) (a)*(a)

#define Count1(a) __builtin_popcount(a)
#define Size(a) (a).size()
#define Reset(a,b) memset(a,b,sizeof(a))
#define Sort(a) sort(a.begin(), a.end())
#define Sorts(a) sort((a).begin(), (a).end(), greater<ll>())

int n,m,bil,ct[105],ans=0,maks;
bool st[105];
vi diffList;
vi vReal;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//    freopen("input.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
//    int a;
//    ll b;
//    char c[500];
//
//    scanf("%d", &a);
//    scanf("%I64u", &b);
//    scanf("%s", c);
//    scanf("%c", c[0]);
//    printf("%d", a);
//    printf("%s", c);
    cin>>n>>m;
    maks = m/n;
    for (int i = 1; i <= m; i++)
    {
        cin>>bil;
        ct[bil] += 1;
        if (!st[bil])
        {
            diffList.PB(bil);
            st[bil] = true;
        }
    }
    if (n > m)
    {
        cout<<0<<endl;
        return 0;
    }
    for (int i = 0; i < Size(diffList); i++)
    {
        while (ct[diffList[i]] >= maks)
        {
            vReal.PB(maks);
            ct[diffList[i]] -= maks;
        }
        vReal.PB(ct[diffList[i]]);
    }
    Sorts(vReal);
    cout<<vReal[n-1]<<endl;
//    for (int i = 0; i < Size(vReal); i++)
//    {
//        cout<<vReal[i]<<' ';
//    }

    return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>

using namespace std;

int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int a[200];
    for(int i=0;i<m;i++)
       scanf("%d",&a[i]);
    sort(a,a+m);

    int x=m/n;
    if(x==0)  printf("0\n");
    else if(x==1) printf("1\n");
    else
    {
        int cp=x;
        for(int i=0;i<m;i++)
        {
            int st=i,c=0;
            while(1)
            {
                if(a[st]==a[st+cp-1]) st=st+cp,c++;
                else st++;
                if(c==n) break;
                if(st>=m) break;
            }
            if(c==n) {printf("%d\n",cp);break;}
            else cp--;
        }
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pb push_back

int a[101], p[101];

main()
{

	int n, m, k = 0, ans = 0;
	cin >> n >> m;

	vector < int > v(101);
	int mx = 0;

	for(int i = 1; i <= m; i++)
	{
		int x; cin >> x;

		v[x] ++;
		mx = max(v[x], mx);
	}

	for(int i = mx; i > 0; i--)
	{
		vector < int > vv(v);
		int k = 0;

		for(int j = 1; j <= 101; j++)
		{
			if(vv[j] >= i)
			{
				vv[j] -= i;
				k++;
			}

			if(k == n)
			{
				cout << i << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
}

 #include<bits/stdc++.h>

    using namespace std;

int n,i,j,k,l,m,c[1010];
bool cm( int x,int y)
{
    return x>y;
}
int main()
{cin>>n>>m;

set<int> q;

for(i=1;i<=m;i++)
{
    cin>>k;
    c[k]++;
    q.insert(k);
    l=max(l,k);
}

if(q.size()==1)
{
    cout<<m/n;
    return 0;
}
else{sort(c+1,c+1+k,cm);
int s;

for(i=1;;i++)
{s=0;
    for(j=1;j<=m;j++)
    {
     s+=c[j]/i;
    }
    if(s<n)
        break;
}
cout<<i-1;
}
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

bool comp(string s1, string s2)
{
	return s1.length()>s2.length();
}

int main()
{
  int n,m,i,c=0,s=0;
  cin >> n >> m;
  int a[m];
  vector<pair<int,int> > v;
  for(i=0;i<m;i++)
  {
    cin >> a[i];
  }
  if(m<n)
  {
    cout << 0;
    return 0;
  }
  sort(a,a+m);
  for(i=0;i<m-1;i++)
  {
    if(a[i]==a[i+1])
        c++;
    else
    {
       v.pb(mp(c+1,a[i]));
       c=0;
    }
  }
  v.pb(mp(c+1,a[m-1]));
  sort(all(v));
  if(v.size()==1)
  {
     cout << v[0].F/n;
     return 0;
  }
  for(i=0;i<v.size();i++)
    {
     if(v[i].F==1)
            {
                v.erase(v.begin()+i);
                i--;
            }
    }
    if(v.size()==0)
    {
      cout << 1;
      return 0;
    }
   int x=v[0].F;
   for(i=0;i<v.size();i++)
   {
     s=s+v[i].F/x;
     //cout << v[i].F << " " << v[i].S << endl;
   }
   if(s>=n)
    cout << v[0].F;
   else
    cout << 0;
}

#include <bits/stdc++.h>
using namespace std;

int check(int cnt[],int n,int days)
{
    int i,x=0;
    for(i=0;i<105;i++)
    {
        x=x+cnt[i]/days;
    }
    if(x>=days)
        return 1;
    else
        return 0;
}

int main()
{
    int n,m;
    cin>>n>>m;

    int arr[m],cnt[105],i;

    for(i=0;i<105;i++)
        cnt[i]=0;
    for(i=0;i<m;i++)
    {
        cin>>arr[i];
        cnt[arr[i]]++;
    }

    int s,e,ans,mid,t,f=0;
    s=0;
    e=m;
    ans=0;
    while(s<=e)
    {
        mid=(s+e)/2;
        if(mid==0)
         {
             mid=1;
             f=1;
         }
        t=check(cnt,n,mid);
        if(t==1)
        {
            ans=max(ans,mid);
            s=mid+1;
        }
        else
            e=mid-1;
        if(f==1)
            break;
    }
    if(n>m)
        ans=0;
    cout<<ans<<endl;
    return 0;
}

#define _USE_MATH_DEFINES
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long     ll;
typedef unsigned int  UInt;
#define ALL(a)          (a).begin(), (a).end()
#define FOR(i,a,b)      for(int i = a;   i <  (int)(b); ++i)
#define FOR_REV(i,a,b)  for(int i = b-1; i >= (int)(a); --i)
#define FOR_EACH(it,a)  for(remove_reference<decltype(a)>::type::iterator it = (a).begin(); it != (a).end(); ++it)
#define FOR_EACH_REV(it,a) for(remove_reference<decltype(a)>::type::reverse_iterator it = (a).rbegin(); it != (a).rend(); ++it)
#define FOR_EACH_CONST(it,a) for(remove_reference<decltype(a)>::type::const_iterator it = (a).begin(); it != (a).end(); ++it)
#define FOR_EACH_CONST_REV(it,a) for(remove_reference<decltype(a)>::type::const_reverse_iterator it = (a).rbegin(); it != (a).rend(); ++it)
template<class T> inline T   sqr(T v)  { return v * v; }
template<class T> inline int sign(T v) { return v == 0 ? 0 : (v > 0 ? 1 : -1); }
template<class T> inline int get_bit(T v, int bit_index) { return (v >> bit_index) & 1; } //return {0,1}
template<class T> inline T   gcd(T a, T b) { while(b) { T t = b; b   = a % b; a   = t; } return a; }
#define IN_INT(a)            int a;       is >> a;
#define IN_INT2(a,b)         int a,b;     is >> a >> b;
#define IN_INT3(a,b,c)       int a,b,c;   is >> a >> b >> c;
#define IN_INT4(a,b,c,d)     int a,b,c,d; is >> a >> b >> c >> d;
#define IN_LL(a)             ll a;        is >> a;
#define IN_LL2(a,b)          ll a,b;      is >> a >> b;
#define IN_LL3(a,b,c)        ll a,b,c;    is >> a >> b >> c;
#define IN_LL4(a,b,c,d)      ll a,b,c,d;  is >> a >> b >> c >> d;
#define IN_STR(s)            string s;    is >> s;

//////////////////////////////////////////////////////////////////////////

istream& input(bool release_tie = false)
{
  ios_base::sync_with_stdio(false);
#ifdef INPUT_FROM_FILE
  static ifstream is("CodeForces/input.txt");
  return is;
#endif
  if (release_tie)
    cin.tie(NULL);
  return cin;
}

ostream& output(bool release_tie = false)
{
  cout << setprecision(15);
  if (release_tie)
    cout.tie(NULL);
  return cout;
}

template <typename T>
void init_v2(vector<vector<T>>& v, int lx, int ly, const T& val = T())
{
  v.resize(lx);
  FOR (i,0,lx)
    v[i].resize(ly, val);
};

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
////a
//void main()
//{
//  istream& is = input();
//  ostream& os = output();
//
//  IN_INT2(n,k);
//  IN_STR(s);
//  vector<bool> a(30,false);
//  FOR_EACH (it,s)
//    a[*it-'a'+1]=true;
//  int sum = 0, last=-1, len=0;
//  FOR (i,0,30)
//  {
//    if (a[i]&&i>last+1)
//    {
//      sum+=i;
//      ++len;
//      last = i;
//      if (len==k)
//        break;
//    }
//  }
//
//  os<<(len==k?sum:-1);
//}
//
//////////////////////////////////////////////////////////////////////////

void main()
{
  istream& is = input();
  ostream& os = output();

  IN_INT2(n,m);
  vector<int> a(101,0);
  FOR (i,0,n)
  {
    IN_INT(t);
    ++a[t];
  }

  FOR_REV (ans,0,101)
  {
    int l = ans;
    FOR_EACH (it,a)
      l -= *it / ans;
    if (l<=0)
    {
      os<<ans;
      break;
    }
  }

  //int res = 0;
  //os << res;
}

//////////////////////////////////////////////////////////////////////////

//void main()
//{
//  istream& is = input();
//  ostream& os = output();
//
//  IN_INT(n);
//
//  //vector<int> a(n);
//  //FOR (i,0,n)
//  //  is >> a[i];
//
//  //int res = 0;
//  //os << res;
//}

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	int data[m],day[100][100],type[100]={0};
	for(int i=0;i<m;i++){
	  scanf("%d",&data[i]);
	  type[data[i]]++;
	  }

	for(int i=0;i<100;i++){
	  for(int j=0;j<100;j++){
	  	day[i][j]=type[i]/(j+1);
	  }
	}

	int max=0;

	for(int i=0;i<100;i++){
		int count=0;
		for(int j=0;j<100;j++){
			count+=day[j][i];
		}
		if(count>=n&&(i+1)>=max)
		max=i+1;
	}
	printf("%d",max);

	return 0;
}

            #include <bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            ll INF =1e9+7;
            typedef pair<ll,ll> ii;
            #define f(i,a,b) for(long long i = a;i < b;i++)
            #define rf(i,a,b) for(long long i=a;i>=b;i--)
            #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
            #define w(t) while(t--)
            #define c(n); cin>>n;
            #define p(n) cout<<n;
            #define pl(n) cout<<n<<endl;
            #define ps(n); cout<<n<<" ";
            int main(){
                fastio;
                ll n,m;
                c(m);
                c(n);
                ll arr[n];
                f(i,0,n){
                    c(arr[i]);
                }
                sort(arr,arr+n);
                vector<long long>c;
                long long last = -INF;
                long long d = 0;
                f(i,0,n){
                    if(last == arr[i]){
                        d++;
                    }
                    else{
                        if(i!=0){
                            while(d > 0){
                                c.push_back(min(d,m));
                                d-=min(d,m);
                            }
                        }
                        d=1;
                    }
                    last = arr[i];
                }
                while(d > 0){
                    c.push_back(min(d,m));
                    d-=min(d,m);
                }
                sort(c.begin(),c.end());
                long long ans=INF;
                if(c.size() < m){
                    p(0);
                }
                else{
                    if(c.size() == m){
                        ans = c[c.size()-m];
                    }
                    else{
                        ans = c[c.size()-m+1];
                    }
                    p(ans);
                }
            }

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>

using namespace std;

bool sortbysec(const pair <int, int> &a, const pair<int, int> &b)
{
  return (a.second < b.second);
}

int main()
{
  int n, m;
  cin >> n >> m;
  std::map<int, int> a;
  vector<pair <int, int>> v;
  for(int i = 0; i < m; i++)
  {
    int x;
    cin >> x;
    a[x]++;
  }
  for(map<int, int> :: iterator itr = a.begin(); itr != a.end(); itr++)
  {
    v.push_back(make_pair(itr->first, itr->second));
  }
  sort(v.begin(), v.end(), sortbysec);
  int i = 0, ans = 0;
  while(1)
  {
    // cout << 'a' <<endl;
    int mini = v[i].second;
    // cout << v[i].second << endl;
    int x = n - 1;
    for(int j = i + 1; j < v.size(); j++)
    {
      // cnt += v[j].second/mini;
      x -= min(v[j].second/mini, x);
      // cout << x << ' ' << mini << endl;
      if(x == 0)
        break;
    }
    // cout << mini << ans << endl;
    if(x == 0)
      {
        ans = max(mini, ans);
    }
    else
      break;
    i++;
  }
  // cout << 'a' << endl;
  cout << ans << endl;
}

// B32
#include<bits/stdc++.h>
using ll = long long int;
#define pb push_back
#define endl "\n"
#define rep(i,n) for(ll i = 0; i < n; i++)
#define all(x) x.begin(),x.end()

using namespace std;

string g = "aabb";
int dx[] = {0, 0, -1, -1, -1, 1, 1, 1};
int dy[] = {-1, 1, -1, 0 , 1, -1, 0, 1};

bool isvalid(ll x, ll y, ll n, int m)
{
	if(x < 0 || x > n-1 || y < 0 || y > m-1)
		return false;
	else
		return true;
}

struct pt{
	int x;
	int y;
};

void solve()
{
	ll n,k;
	cin >> n >> k;

	vector<ll> v;
	v.resize(k);

	ll ar[101];
	memset(ar,0,sizeof(ar));

	rep(i,k) cin >> v[i], ar[v[i]]++;

	vector<ll> ans;
	for(ll i = 1; i <= n; i++)
	{
		ll sum = 0;
		for(ll j = 1; j <= 100; j++)
		{
			sum += (ar[j]/i);
		}

		if(sum >= n)
			ans.pb(i);
		else
			break;
	}

	if(ans.size() != 0)
		cout << ans[ans.size()-1] << endl;
	else
		cout << 0 << endl;
}

int main()
{
	int t = 1;// cin >> t;
	while(t--)
	{
		solve();
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n,m;
    cin>>n>>m;
    if(m<n)
    {cout<<0<<endl;
     return 0;}

    int count[101];
    for(int i=0;i<101;i++)
        count[i]=0;
    for(int i=0;i<n;i++)
    {
        int d;
        cin>>d;
        count[d]++;
    }
    sort(count,count+101);
    int te=0;
    for(int i=0;i<101;i++)
    {
        if(count[i])
            te++;
    }

    int mi=1000000;
    for(int i=100;count[i]!=0;i--)
    {
        mi=min(count[i],mi);
    }
    //cout<<mi;

    {
        cout<<mi<<endl;
    }

}

#include<bits/stdc++.h>
using namespace std;
const int maxn = int(1e5) + 100;
const int maxm=100;
int num[maxn];
int tmp[maxn];
bool solve(int x,int n,int m) {
	if(x==0)
		return true;
	for(int i=1; i<=maxm; i++)
		tmp[i]=num[i];
	int pos=1;
	int top=0;
	while(pos<=maxm) {
		if(tmp[pos]>=x) {
			tmp[pos]-=x;
			top++;
			if(top>=n)break;
		} else {
			pos++;
		}
	}
	if(top>=n)
		return true;
	else
		return false;
}
int main() {
	int n,m;
	int u;
	while(~scanf("%d %d",&n,&m)) {
		memset(num,0,sizeof(num));
		for(int i=1; i<=m; i++) {
			scanf("%d",&u);
			num[u]++;
		}
		int l=0,r=100;
		while(l<r) {
			int mid=(l+r)>>1;
			if(solve(mid,n,m))
				l=mid+1;
			else
				r=mid;
		}
		printf("%d\n",l-1);
	}
	return 0;
}

/**Made By AbdoMo007**/
/**hg;,] ]i ohw fdh**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string s;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int p,n;
    cin>>p>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    int freq[1000]={};
    for(int i=0;i<n;i++)
    {
        freq[arr[i]]++;
    }
    //cout<<freq[1]<<" "<<freq[2]<<" "<<freq[3]<<" "<<freq[4]<<endl;
    vector<int>fr;
    int counter=0;
    if(p>n)
    {
        cout<<counter;
        return 0;
    }
    int maxi = *max_element(freq,freq+101);
    if (maxi == 1)
    {
        cout<<1;
        return 0;
    }
    if(n == p)
    {
        cout<<1;
        return 0;
    }
    for(int i=1;i<=100;i++)
    {
        if(freq[i]>0)
        {
            fr.push_back(freq[i]);
        }
    }
    int ma = -200000;
    sort(fr.begin(),fr.end());
    while(fr.size()>0)
    {
        int sum=0;
        for(int i=0;i<fr.size();i++)
        {
            sum+=fr[i];
        }
        sum/=p;
        if(min(sum,fr[0])>ma)
        {
            ma=min(sum,fr[0]);
        }
        fr.erase(fr.begin());
    }
    if(maxi/p*3>0)
    ma=min(ma,maxi/p*3);
    cout<<ma;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

   int m,n;
   cin>>n>>m;

   int a[m+1],deepak[n+1],b[101];

   for (int i = 1; i < 101; ++i)
   {
       b[i]=0;
   }

   for (int i = 1; i <=m; ++i)
   {
      cin>>a[i];
      b[a[i]]++;

   }
if (m<n)
   {
      cout<<"0"<<endl;
      return 0;
   }
   sort(b+1,b+100+1);

   for (int i = 1; i <=n ; ++i)
   {
       deepak[n+1-i]=b[100+1-i];

   }

    // for (int i = 1; i < n+1; ++i)
    // {
    //     cout<<deepak[i]<<" ";
    // }
    // cout<<endl;

   int min=101,max=0;
min=deepak[1];
max=deepak[n];
   while((max)>=(2*min))
   {
         cout<<max<<" > "<<min<<endl;
         deepak[1]=max/2;
         deepak[n]=max/2;

         sort(deepak+1,deepak+1+n);
         min=deepak[1];
         max=deepak[n];
   }

cout<<min<<endl;

}

#include<stdio.h>
#include<string.h>
#include<stack>
#include<string.h>
#include<queue>
#include<algorithm>
#include<iostream>
#include<map>
#include<vector>
#define PI acos(-1.0)
using namespace std;
typedef long long ll;
const int MAXN=3e5+10;
int m,n,l;
int str[MAXN];
map<int,int>::iterator it;
int  solve(int mid)
{
    int ans=0;
    for(int i=0;i<l;i++)
    {
        ans+=str[i]/mid;
    }
    printf("%d %d %d\n",mid,ans,l);
    if(ans>=m)
        return 1;
    return 0;
}
int main()
{
    cin>>m>>n;
    int k;
    map<int,int>mp;
    for(int i=0;i<n;i++)
    {
        cin>>k;
        mp[k]++;
    }
    for(it=mp.begin();it!=mp.end();it++)
    {
        str[l++]=it->second;
    }
    int left=0,right=100,mid;
    while(left<=right)
    {
        mid=(left+right)/2;
        if(solve(mid))
        {
            left=mid+1;
        }
        else
        {
            right=mid-1;
        }
    }
    cout<<right<<endl;
    return 0;
}

#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <chrono>
#include <map>
#include <random>
#include <unordered_map>
#include <iterator>
#include <fstream>
#include <numeric>
#include <functional>
#include <exception>
#include <set>
#include <queue>

using namespace std;
using namespace chrono;

bool USE_FILE = false;
fstream fileStream;
#define READ (USE_FILE ? fileStream : cin)

using LL = long long;

template<typename T, typename... Args>
static int SpendTime(T func, Args&&... args)
{
	auto start = steady_clock::now();
	func(args...);
	return duration_cast<milliseconds>(steady_clock::now() - start).count();
}

template <class T>
decltype(auto) ReadVector(LL n)
{
	vector<T> res(n);
	for (auto& i : res)
		READ >> i;
	return res;
}

struct READ_LL
{
	READ_LL() { READ >> value_; }
	operator LL&() { return value_; }
private:
	LL value_;
};

int main(int argc, char** argv)
{
	if (USE_FILE) fileStream.open("M:\\test.txt", ios::in);

	READ_LL n, m;
	unordered_map<LL, LL> valuesHashMap;
	valuesHashMap.reserve(n);
	for (int i = 0; i < m; ++i)
	{
		LL value;
		READ >> value;
		++valuesHashMap[value];
	}

	enum { value, count };
	vector<pair<LL, LL>> vec;
	vec.reserve(valuesHashMap.size());
	for (const auto& val : valuesHashMap)
		vec.push_back(val);

	sort(vec.begin(), vec.end(), [](const auto& lhs, const auto& rhs)
	{
		return get<count>(lhs) < get<count>(rhs);
	});

	auto sum = accumulate(vec.end() - min(vec.size(), (size_t)n), vec.end(), 0, [](int sum, const auto& elem)
	{
		return sum + get<count>(elem);
	});

	cout << sum / n;
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
map<ll,ll>m1;
bool cmp(ll a,ll b)
{
	if(m1[a]>m1[b])
	{
		return true;
	}
	return false;
}
ll gcd(ll a,ll b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
bool isprime(ll n)
{
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
int main()
{
	ll n,m,i;
	cin>>n>>m;
	ll a[m];
	for(i=0;i<m;i++)
	{
		cin>>a[i];
		m1[a[i]]++;
	}
	sort(a,a+m,cmp);
	ll b[m],j=0;
	for(i=0;i<m;)
	{
		if(j!=n)
		{
			b[j]=a[i];
			i=i+m1[a[i]];
			j++;
		}
		else
		{
			break;
		}
	}
	ll max1=0,ans,ctr=0;
	for(i=0;i<j;i++)
	{
		ctr=ctr+m1[b[i]];
		//cout<<ctr<<endl;
		ans=(ctr)/n;
		if(ans>max1)
		{
			max1=ans;
		}
	}
	cout<<max1;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,m,num[110],cnt[110]={0},flag[110],Max=0,k=0,temp=0;
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		cin>>num[i];
		cnt[num[i]]++;
	}
	for(int i=1;i<110;i++)
	{
		if(cnt[i]) flag[k++]=cnt[i];
	}
	sort(flag,flag+k);

	if(k==1)
	{
		if(flag[0]>=n) cout<<flag[0]/n<<endl;
		else cout<<0<<endl;
	}
	else
	{
		for(int i=k-1;i>=0;i--)
		{
			if(k-1-i>=n) break;
			int sum=0;
			//if(flag[k-1]/n > flag[k-2])
			//{
			//	cout<<flag[k-1]/n<<endl;
			//	break;
			//}
			for(int j=k-1;j>=i;j--)
			{
				sum+= flag[j]/flag[i];
			}
			if(sum==n)
			{
				temp=1;
				cout<<flag[i]<<endl;
				break;
			}
			else
			if(sum>n)
			{
				int L=flag[i],R=flag[i+1];
				while(L<R)
				{
					int mid=(L+R)>>1,xx=0;
					for(int j=k-1;j>i;j--)
					{
						xx+= flag[j]/mid;
					}
					if(xx>sum) L=mid+1;
					else R=mid;
				}
				cout<<L<<endl;
				temp=1;
				break;
			}
		}
		if(temp==0) cout<<0<<endl;
	}
	return 0;
}

/**/
#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	double n,m,a[1000001];
	long long b[100001],ans=1;
	cin>>n>>m;
	if(n>m){
		cout<<0<<endl;
		return 0;
	}
	for(int i=0;i<m;i++){
		cin>>b[i];
		a[b[i]]++;
	}
	sort(a,a+100001);
	for(int i=0;i<100001;i++){
		ans+=floor((double)a[i]/n);

	}
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    return (a.second > b.second);
}

int main(){

    //freopen("aain.txt", "r", stdin);

    int n, m;

    cin>>n>>m;

    if(m < n){
        cout<<"0";
        return 0;
    }

    int a[m];
    int i;

    for(i = 0; i < m ; i++){

        cin>>a[i];

    }

    vector < pair < int, int> > food;

    int seen[m];

    for(i = 0; i < m; i++)
        seen[i] = 0;

    for(i = 0; i < m; i++) {
        if(seen[i] == 0) {
            int c = 0;
            for(int j = i; j < m; j++)
                if(a[j] == a[i]) {
                    c += 1;
                    seen[j] = 1;
                }

            food.push_back(make_pair(a[i], c));
        }
    }

    sort(food.begin(), food.end(), sortbysec);

    int c = m / n;
    int sum  = 0;

    while(c > 1){

        for(i = 0; i < food.size(); i++) {

            sum += food[i].second / c;

        }

        if(sum == n){
            cout<<c;
            return 0;
        }

        c--;
    }

    cout<<c;
    return 0;

}

/*
    @uthor: Amit Kumar
    user --> CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll long long
#define ld double
#define endl "\n"

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

bool mysort(pair<ll,ll> A , pair<ll,ll> B){
    return A.first<B.first;
}

void virus(){
         ll len,m;
         cin>>len>>m;
         vector<ll> arr(m);
         map<ll,ll> cnt_typ;
         for(auto i=0;i<m;i++){
             cin>>arr[i];
             cnt_typ[arr[i]]+=1;
         }
         for(auto days = len; days>=1; days--){
             map<ll,ll> cnt_typ_c(cnt_typ.begin(),cnt_typ.end());
             ll temp = 0;
             for (auto i=1; i <= 100; i++){
                    while(cnt_typ_c[i] >= days){
                        temp += 1;
                        cnt_typ_c[i] -= days;
                    }
                    if(temp>=len) {
                        cout<<days;
                        exit(0);
                    }
             }
         }
         cout<<"0";

}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t = 1;
    //cin>>t;
    while(t--){
         //auto start = high_resolution_clock::now();
           virus();
         //auto stop = high_resolution_clock::now();
         //auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define min(a,b) a>b?b:a
int main()
{
	int n,m,ans;
	cin >> n >> m;
	int a[m],*count;
	count = (int*)calloc(101,sizeof(int));
	for(int i = 0; i < m; i++)
	{
		cin >> a[i];
		count[a[i]]++;
	}
	sort(count, count+101, greater<int>());
	ans = count[n-1];
	int j = 0,i = 2,k = 2;
	while(i <= n && j < n && k <= n)
	{
		if(count[j]/i > count[n-k+1])
		{
			if(ans > min(count[j]/i,count[n-k]))
				ans = min(count[j]/i,count[n-k]);
			k++;
		}
		else
		{
			j++;
			i = 1;
		}
		i++;
	}
	cout << ans;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define pb              push_back
#define nl              printf("\n")
#define ll              long long int

#define F               first
#define S               second

#define gcd(x,y)        __gcd(x,y)
#define lcm(a,b)        (a*(b/gcd(a,b)))

#define MOD             1000000007
#define MX              INT_MAX
#define Sz              10005
#define FastIO          { ios_base::sync_with_stdio(false); cin.tie(0); }

char f,g;
string s,p;
double aa,bb,cc;
int arr[Sz],brr[Sz];
vector< int > v,va,vb;
vector < pair < int, int  > > vp;
map< int, int > mp;

void sort_arry(int n)
{
    for(int i=1; i<=n; i++)
    {
        for(int j=i+1; j<=n; j++)
        {
            if(arr[i]>arr[j])
            {
                swap(arr[i],arr[j]);
                swap(brr[i],brr[j]);

            }
        }
    }
}
int main()
{
    int a,b,c, n,m,t, i,j,k, x,y,z;
    cin>>n>>m;

    for(i=1; i<=m; i++)
    {
        cin>>arr[i];
        if(!mp[arr[i]])
            v.pb(arr[i]);
        mp[arr[i]]++;
    }
    for(i=0; i<v.size(); i++)
    {
        arr[i+1]=mp[v[i]];
        brr[i+1]=v[i];
    }
    for(i=v.size(); i<n; i++)
    {
        arr[i+1]=0;
        brr[i+1]=0;
    }

    if(n>m)
        return 0;

    else
    {
        while(true)
        {
            sort_arry(n);

            x=arr[1];
            y=arr[n]/2;

            a=brr[1];
            b=brr[n];
            if(x>y || (x==y && a!=b) || y==0)
                break;
            else if(x==y && a==b)
            {
                if(y==1)
                    break;
                else
                {
                    x=(arr[1]+arr[b])/2;
                    arr[1]=x;
                    arr[n]=x;
                    arr[n]+=((arr[1]+arr[b])%2);
                }
            }
            else
            {

                arr[1]=y;
                brr[1]=b;
                arr[n]-=y;
            }
        }
    }
    cout<<arr[1]<<endl;

    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
map<ll,ll>m1;
bool cmp(ll a,ll b)
{
	if(m1[a]>m1[b])
	{
		return true;
	}
	return false;
}
ll gcd(ll a,ll b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
bool isprime(ll n)
{
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
int main()
{
	ll n,m,i;
	cin>>n>>m;
	ll a[m];
	for(i=0;i<m;i++)
	{
		cin>>a[i];
		m1[a[i]]++;
	}
	sort(a,a+m,cmp);
	ll b[n],j=0;
	for(i=0;i<m;)
	{
		if(j!=n)
		{
			//cout<<a[i]<<endl;
			b[j]=a[i];
			i=i+m1[a[i]];
			j++;
		}
		else
		{
			break;
		}
	}
	ll max1=0,ans,ctr=0;
	for(i=0;i<j;i++)
	{
		ctr=ctr+m1[b[i]];
		//cout<<b[i]<<" "<<m1[b[i]]<<endl;
		//cout<<ctr<<endl;
		ans=(ctr)/n;
		ll flag=0;
		ll min1=INT_MAX;
		for(ll k=0;k<=i;k++)
		{
			if(min1>m1[b[k]])
			{
				min1=m1[b[k]];
			}
			if(m1[b[k]]<ans)
			{
				flag=1;
			}
		}
		if(flag==1)
		{
			ans=min1;
		}
		if(ans>max1)
		{
			max1=ans;
		}
	}
	cout<<max1;
	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int n, m, a[105];
int i, c;

int main(void) {
	ios::sync_with_stdio(false);
	cin >> n >> m;
	for (i = 0; i < m; i++)
		cin >> a[i];
	for (i = 1; i < 10000; i++) {
		c = 0;
		for (int j = 0; j < m; j++) {
			c += a[j] / i;
		}
		if (c < n) break;
	}
	cout << i - 1;
}

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

bool compare(int a,int b)
{
    return a>b;
}

int main()
{
    int n,m;
    cin>>n>>m;
    int a[m];
    int freq[101];
    memset(freq,0,sizeof(freq));
    for(int i=0;i<m;i++)
    {
        cin>>a[i];
        freq[a[i]]++;
    }
    sort(freq,freq+101,compare);
    int max=m/n;
    int min=freq[n-1];
    int last=min;/*
    for(int i=0;i<m;i++)
        cout<<freq[i]<<" ";
    cout<<endl;*/
    if(max<=min || max<=1)
        cout<<max;
    else
    {
        int k=0;
        for(int i=min+1;i<=max;i++)
        {
            for(int j=0;j<m;j++)
            {
                k+=freq[j]/i;
                if(k>=max)
                    break;
            }
            if(last>k)
                break;
            //cout<<last<<" "<<k<<"\n";
            if(k>max)
            {
                last=max;
                break;
            }
            //cout<<last<<" "<<k<<"\n";
            last=i;
            k=0;
        }
        cout<<last;
    }
}

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main()
{
    int n,m;
    cin>>n>>m;
    int a[m],f[101]={0};
    vector<int> v;
    int i;
    for(i=0;i<m;i++)
    {
        cin>>a[i];
        f[a[i]]++;
    }
    for(i=0;i<=100;i++) if(f[i]!=0) v.push_back(f[i]);
    sort(v.begin(),v.end());
    int maxm=0,pos=0,l=0;
    for(i=m/n;i>0;i--)
    {
       // cout<<"checking day no. "<<i<<endl;
        l=0;
        for(int j=v.size()-1;j>=0;j--)
        {
            l+=v[j]/i;
            if(l==n) break;
        }
        //cout<<"no. of participants accommodated "<<l<<endl;
        if(l==n) maxm = max(maxm,i);
    }
    cout<<maxm;
}

#include <bits/stdc++.h>
using namespace std;

const int MAX = 4e3;
const int OO = 0x3f3f3f3f;
const long double EPS = 1e-6;
const long long MOD = 1000000000;

#define bug(x) cout << #x << " = " << x << '\n'
#define FOR(i, a, n) for(int i = a; i < (int)n; i++)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mt make_tuple
#define all(vetor) vetor.begin(), vetor.end()
#define X real()
#define Y imag()
//#define gc getchar_unlocked

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef complex<ll> Pll;
typedef complex<ld> Pld;

int n, m, buc[200], aux;

bool check(vector<int> arr, int d)
{
	REP(i, arr.size())
		if(arr[i] > d)
		{
			int aux = arr[i] - d;
			arr[i] -= d;
			if(aux < d) continue;
			REP(j, arr.size())
				if(arr[j] < d)
					arr[j] = aux, j = arr.size();
		}
	sort(all(arr), [](int a, int b){ return a > b; });
	REP(i, n)
		if(arr[i] < d)
			return false;
	return true;
}

int main()
{
	vector<int> arr;
	int sum = 0;
	cin >> n >> m;
	REP(i, m) cin >> aux, buc[aux]++, sum += aux;
	if(sum < n) return puts("0"), -1;
	REP(i, 200) if(buc[i]) arr.pb(buc[i]);
	sort(all(arr), [](int a, int b){ return a > b; });
	while((int)arr.size() < n)
		arr.pb(0);

	int ans = 0;
	REP(i, 300)
		if(check(arr, i))
			ans = i;
	cout << ans << '\n';

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct A
{
    ll x,val;
};
bool cmp(A a,A b)
{
    return a.x>b.x;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;
    while(cin>>n>>m)
    {
        ll cnt[1005];
        memset(cnt,0,sizeof cnt);
        vector<ll> arr;
        for(int i=1; i<=m; i++)
        {
            ll x;
            cin>>x;
            if(cnt[x]==0)
            {
                arr.push_back(x);
            }
            cnt[x]+=1;
        }
        vector<A> ar;
        for(int i=0; i<arr.size(); i++)
        {
            A a;
            a.val=arr[i];
            a.x=cnt[arr[i]];
            ar.push_back(a);
        }
        sort(ar.begin(),ar.end(),cmp);
        if(n>m)
            cout<<0<<endl;
        else
        {
            ll  mx=0;

            ll mn=1e18;
            if(ar.size()>=n)
            {
                mn=1e18;
                int cnt=0;
                for(int i=0; i<ar.size(); i++)
                {
                    mn=min(mn,ar[i].x);
                    cnt++;
                    if(cnt==n)
                        break;
                }
                mx=max(mx,mn);

            }
            int j=1;
            for(int k=1;k<=n;k++)
            {
                int cnt=0;
                ll mn=1e18;
                for(int i=0;i<j && i<ar.size();i++)
                {
                    cnt += k;
                    mn=min(mn,ar[i].x/k);
                    if(cnt>k)
                    {
                        mn=0;
                        break;
                    }
                }
                for(int i=j;i<ar.size();i++)
                {
                    if(cnt==n)
                        break;
                    mn=min(mn,ar[i].x);
                    cnt++;
                }
                //cout<<mn<<endl;
                if(cnt==n) mx=max(mx,mn);

            }
            cout<<mx<<endl;
        }

    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pb push_back

int a[101], p[101];

main()
{

	int n, m, ans = 0;
	cin >> n >> m;

	vector < int > v(101);
	int mx = 0;

	for(int i = 1; i <= m; i++)
	{
		int x; cin >> x;

		v[x] ++;
		mx = max(v[x], mx);
	}

	//cout << mx << endl;

	for(int i = mx; i > 0; i--)
	{
		vector < int > vv(v);
		int k = 0;

		for(int j = 1; j <= 101; j++)
		{
			while(vv[j] >= i) {
				vv[j] -= i;
				k++;
			}

			if(k >= n)
			{
				cout << i << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
}

#include<bits/stdc++.h>
#define hell 1000000007
#define for(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define pb push_back
#define vi vector<int>
using namespace std;
int a[101];
int main()
{
	int n,m;
	cin>>n>>m;
    int t;
	for(i,0,m)
    {
        cin>>t;
        a[t]++;
    }
    sort(a,a+101);
    reverse(a,a+101);
    //cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<endl;

    if(n>m)
        cout<<0;
    else
    {
        int ans=0;
        for(i,0,n)
            ans+=a[i];
        int mi=ans/n;
        //cout<<mi<<endl;
        int cnt=0;
        int i=0;
        while(cnt<n&&i<101)
        {
            //cout<<a[i]<<endl;

           // cout<<a[i]/mi<<endl;
            if(a[i]>=mi)
                cnt+=(a[i]/mi);
            else
                cnt++;
            //cout<<cnt<<endl;
            i++;
        }
        i--;
        if(a[i]>=2*mi)
            cout<<mi;
        else
            cout<<a[i];
    }

	return 0;
}

    #include <bits/stdc++.h>

        using namespace std;
        typedef long long ll;
        int n,m;
        int cnt[104];
        vector<int>v;
        int ok(int x)
        {
            int s=0;
            int t=x;
            for(int i=0;i<v.size();i++)
            {
                s+=cnt[v[i]]/x;
                if(s>=n)return 1;
            }
            return 0;
        }
        int main()
        {

            ios::sync_with_stdio(false);
            cin>>n>>m;
            memset(cnt,0,sizeof cnt);
            for(int i=0;i<m;i++){
                int x;
                cin>>x;
                if(!cnt[x])v.push_back(x);
                cnt[x]++;
            }
            int ans;
            int f,l;
            f=1;l=104;
            int ctr=0;
            int mid;

            while(f<=l)
            {

                mid=(f+l)/2;
                if(ctr>100)break;
                ctr++;
                if(ok(mid))
                {
                    ans=mid;
                    f=mid;
                }
                else
                    l=mid-1;
            }
            if(n>m)cout<<0<<endl;
            else
            cout<<mid<<endl;
            return 0;
        }

#include<bits/stdc++.h>
#include<vector>

using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	int ans;
	if(n>m)
		ans=0;

	int arr[m];
	for(int i=0;i<m;i++){
		cin>>arr[i];
	}
	int a[101];
	for(int i=0;i<101;i++)
		a[i]=0;
	for(int i=0;i<m;i++)
		a[arr[i]]++;
	vector<int> v;
	for(int i=0;i<101;i++){
		if(a[i]>0)
			v.push_back(a[i]);
	}

	sort(v.begin(),v.end());
	int	l=v.size();
	//cout<<l;
	int cnt=0;
	int x;
	for(x=1;x<m;x++){
		int i=l-1;
		cnt=0;
		while(i>=0){
			int y=v[i];
			while(y>=x){

			y=y-x;
			cnt++;
			}
			if(cnt>=n)
				break;
			i--;
		}

		if(cnt<n){
			ans=x-1;
			break;
		}
	}
	cout<<ans;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{

	// freopen("input.txt","r",stdin);
	// freopen("output.txt", "w", stdout);
 int num,size;
 cin>>num>>size;
 int a[size];
 map <int,int> m;

for(int i=0;i<size;i++){
	cin>>a[i];
}

for(int i=0;i<size;i++){
	m[a[i]]++;
}
for(int i=0;i<m.size();i++){
	//cout<<m[i]<<endl;
}
int sum=0;
int maxtype = size/num;
while(maxtype>0){
	 sum=0;
for(int i=0;i<m.size();i++){
	sum += m[i]/maxtype;
	if(sum==num){
		//cout<<"fs"<<sum<<endl;
			cout<<maxtype<<endl;
			return 0;
		}
}
maxtype--;
}
if(sum==0)
	cout<<sum<<endl;
return 0;

}

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define bs binary_search
void ans()
{
    int l,num,i;
    cin>>l>>num;
    int A[200]={0},k=1,c=0,flag=0,sum=0;
    for(i=0;i<num;i++)
    {
        int x;
        cin>>x;
        A[x]++;
    }
    vector <int> v;
    for(i=0;i<150;i++)
    {
        if(A[i]!=0)
        {
            v.push_back(A[i]);
            sum+=A[i];
        }
    }
    if(sum<l)
    {
        cout<<0;
        exit(0);
    }
    for(i=1; ;i++)
    {
        for(int j=0;j<v.size();j++)
        {
            if(v[j]<i)
            {
                c++;
            }
        }
        if(c!=0)
        {
            for(int j=0;j<v.size();j++)
            {
                if(v[j]>=i*(c+1))
                {
                    c=0;
                    break;

                }
                else
                {
                    flag=1;
                }
            }
        }
        k++;
        if(flag==1)
        {
            break;
        }
    }
if(flag==1&&i-1<=l)
cout<<i-1;
else
{
    cout<<l;
}
}
int main()
{
    ios::sync_with_stdio(0);
	cin.tie(0);
	ans();
}

#include <bits/stdc++.h>
using namespace std;

#define FOR(cont,start,end)	for(int (cont) = (start), cont##_END = (end);   (cont) <  cont##_END; (cont)++)
#define ROF(cont,start,end)	for(int (cont) = (end)-1, cont##_END = (start); (cont) >= cont##_END; (cont)--)
#define LOG(x)				(31 - __builtin_clz(x))
#define W(x)				cerr << "\033[31m" << #x << " = " << x << "\033[0m" << endl;

#define oo 					int(1e9)
#define ep					int(1e-9)
#define pb					emplace_back
#define ff					first
#define ss					second
#define sz(v)				ll(v.size())

using ll = long long int;
using llu = long long unsigned int;
using uint = unsigned int;
using ii = pair<int,int>;

ll people, foods, x, food[1000], low, high, mid;

bool check(ll days){
	ll cnt = 0;
	FOR(i, 0, 100)cnt += food[i] / days;
	return cnt >= people;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	cin >> people >> foods;
	FOR(i, 0, foods){
		cin >> x;
		food[x-1]++;
	}

	low = 0;
	high = 1000000;
	FOR(i, 0, 1000){
		if(not low)break;
		mid = (low + high) / 2;
		if(check(mid))low = mid;
		else high = mid-1;
	}
	cout << low << endl;
}

#include <bits/stdc++.h>
using namespace std;

const int M = 1e2 + 7;
int cnt[M];

int main()
{
    ios_base::sync_with_stdio(false),cin.tie(0);

    int n,k;
    cin >> n >> k;

    for(int i = 0; i < k; i++){
        int x;
        cin >> x;
        cnt[x]++;
    }
    int loop = 100;
    int lo = 0, hi = 200, mid;

    while(loop--){
        mid = (lo + hi) / 2;
        if(mid == 0) break;
        int s = 0;
        for(int i = 0; i <= 100; i++){
            s += cnt[i] / mid;
        }
        if(s == n) break;
        if(s < n)
            hi = mid;
        else
            lo = mid;
        //if(hi <= lo) break;
        //if(mid == 0) break;
        //cout << lo << ' ' << hi << endl;
    }

    cout << lo << endl;

    return 0;
}

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  vector <int> a(100);
  for(int i = 0; i < m; i++)
  {
    int x;
    cin >> x;
    a[x]++;
  }
  for(int d = 100; d >= 1; d--)
  {
    vector <int> c(a);
    int k = 0;
    for(int i = 1; i <= 100; i++)
    {
      if(c[i])
        k += c[i]/d;
    }
    if(k >= n)
    {
      cout << d << endl;
      return 0;
    }
  }
  cout << 0 << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n, m, i, a[100005], cnt[100005], low, high, mid, ans;
bool isPossible(int val) {
    int ans = 0;
    for(int i = 0; i < m; i++) {
        ans += cnt[i]/val;
    }
    //cout<<ans<<" "<<val<<endl;
    return (ans >= n);
}
int main() {

    cin>>n>>m;
    memset(cnt, 0, sizeof cnt);
    for(int i = 0; i < m; i++) {
        cin>>a[i];
        cnt[a[i]]++;
    }
    sort(cnt, cnt+100);
    reverse(cnt, cnt+100);
    ans = 0;
    low = 0;
    high = m;
    int mx = 0;
    while(high - low > 1) {
        mid = (low + high)/2;
        if(isPossible(mid)) {
            low = mid;
        }
        else {
            high = mid;
        }
    }
    cout<<low<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int n,m;
    cin>>n>>m;
    int arr[200];
    int ff[200]={0};
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        ff[arr[i]]++;
    }
    if(m<n)cout<<0;
    else{
        vector<int>v;
        for(int i=0;i<m;i++)
        {
            if(ff[arr[i]]>0)
            {
                v.push_back(ff[arr[i]]);
                ff[arr[i]]=0;
            }
        }
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        int low=1,high=m,mid;
        int ans=0;
        while(low<=high)
        {
            mid=(low+high)>>1;int rnt=0;
            for(int i=0;i<v.size();i++)
            {
                rnt+=(v[i]/mid);
            }
            if(rnt>=mid)
            {
                low=mid+1;
                ans=max(mid,ans);
            }
            else high=mid-1;
        }
        cout<<ans;
    }

    return 0;
}

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <memory.h>
#include <vector>
#include <queue>
#include <stack>

#define INF 1e+7
#define ll long long

using namespace std;

bool cmp1(int a,int b){
    return a > b;
}

int main(){
    int n,m,a[105],b[105];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    for(int i = 0; i < m; ++i){
        scanf("%d",&a[i]);
        b[a[i]]++;
    }
    sort(b,b+101,cmp1);
    for(int i = 1; i <= 100; ++i){
        int num = 0;
        for(int j = 0;b[j] != 0 && j < 100; ++j){
            num += b[j]/i;
            if(num >= n)
                break;
        }
        if(num < n){
            printf("%d",i-1);
            break;
        }
    }
}

#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
int a[1005];
int n,m;int t=0;
bool C(int x)
{
	int cnt=0;
	for(int i=1; i<=t; i++)
	{
		cnt+=a[i]/x;
	}
	if(cnt>=n)return true;
	else return false;
}
int main()
{
	cin>>n>>m;
	int sum=0;
	for(int i=1; i<=m; i++)
	{
		int x;
		cin>>x;
		sum+=x;
		mp[x]++;
	}
	if(sum<n)printf("0\n");
	else
	{
		for(map<int,int>::iterator poi=mp.begin(); poi!=mp.end(); poi++)
		{
			//printf("%d %d\n",poi->first,poi->second);
			a[++t]=poi->second;
		}
		int l=1,r=a[1];
		int ans=0;
		while(l<=r)
		{
			int mid=l+(r-l)/2;
			if(C(mid)==false)
				r=mid-1;
			else
				l=mid+1,ans=mid;
		}
		cout<<ans<<endl;
	}

}

#include<bits/stdc++.h>
using namespace std;
int solve(vector<int> freqmain, int t,int n) {
    int sum =0;
//        while (i<freqmain.size() && freqmain[i] >= t) {
//            sum += freqmain[i];
//            i++;
//        }
        for(int i=0;i<freqmain.size();i++) {
            if(freqmain[i]<t) {
                break;
            }
            sum+=freqmain[i];
        }
        if (sum >= n * t) {
            return 1;
        } else {
            return 0;
        }
}
int main() {
    int n;
    int m;
    cin>>n;
    cin>>m;
    vector<int> a(m);
    set<int> s;
    vector<int> freq(101,0);
    for(int i=0;i<m;i++) {
        cin>>a[i];
        s.insert(a[i]);
        freq[a[i]]++;
    }
    if(m<n) {
        cout<<0<<'\n';
        return 0;
    }
    else if(s.size()==1) {
        int ans = m/n;
        cout<<ans<<'\n';
    }
    else {
//        sort(a.rbegin(),a.rend());
        vector<int> freqmain;
        for(int i=0;i<101;i++) {
            if(freq[i]) {
                freqmain.push_back(freq[i]);
            }
        }
        int l = 1;
        int temp = *min_element(freqmain.begin(),freqmain.end());
        int r = *max_element(freqmain.begin(),freqmain.end());
        sort(freqmain.rbegin(),freqmain.rend());
        vector<int> ans;
        while(l<=r) {
            int mid = (l+r)/2;
            if(solve(freqmain,mid,n)) {
                ans.push_back(mid);
                l=mid+1;
            }
            else {
                r=mid-1;
            }
        }
        int z = ans.size();
        if(z==0){
            cout<<0<<'\n';
        }
        else {
            if(ans[z-1]<temp)
                cout << ans[z - 1] -1 << '\n';
            else {
                cout<<ans[z-1]<<'\n';
            }
        }
    }
}

#include<bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;

const int inf = 1e9 + 7;
const int mnx = 3e5 + 9;

ll n, m;
ll a[mnx];
ll q[mnx];
vector<ll> v;

int main(){

cin>>n>>m;

for(int i=1; i<=m; i++){
    cin>>a[i];
    q[a[i]]++;
    if(q[a[i]]){
        v.pb(a[i]);
    }
}

sort(v.rbegin(),v.rend());

int go = m / n;

while(go != 0){
    int ans = 0;
    for(int i=0; i<v.size(); i++){
        ans += q[v[i]] / go;
    }
    if(ans >= n) break;
    go--;
}

cout<<go;

return 0;

}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

bool f(int i,int j){return i>j;}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m, x,nr=0;
    vector<int> v(101,0);
    cin>>n>>m;
    if(m<n) {cout<<0;return 0;}
    for(int i=0;i<m;i++){
        cin>>x;
        v[x]++;
        if(v[x]==1)
            nr++;
    }
    sort(v.begin(),v.end(),f);
    if(n==1){cout<<v[0];return 0;}

    int s=v[0];
    for(int i=1;i<min(n,nr);i++)
    {
        s+=v[i];
    }
    m = s/n;
    while(m)
    {
        int t=0;
        for(int i=0; i<min(n,nr); i++)
        {
            t+=v[i]/m;
            if(t==n)
            {
                cout<<m;
                return 0;
            }
        }
        m--;
    }
    cout<<v[min(n,nr)-1];
    return 0;

}

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main() {
	int m,n;
	cin >> n >> m;
	int* food;
	food=new int[m];
	for(int i=0;i<m;i++)
	cin >> food[i];
	int had=m/n;
	if(had==0)
	{
		cout << 0;
	}
	else
	{

		int exist[100];
		for(int i=0;i<100;i++)
		exist[i]=0;
		int e=0;
		int kol[100];
		for(int i=0;i<m;i++)
		{
			for(int j=1;j<=100;j++)
			{
				if(food[i]==j)
				{

					exist[j]+=1;
					break;
				}
			}
		}
		for(int i=0;i<100;i++)
		{
			if(exist[i]>0)
			{
				kol[e]=exist[i];
				e++;
			}
		}
		for(int i=0;i<e;i++)
		{
			for(int j=i+1;j<e;j++)
			{
				if(kol[j]>kol[i])
				{
					int temp=kol[i];
					kol[i]=kol[j];
					kol[j]=temp;
				}
			}
		}
		int check;
		int possible=0;
		for(int j=had;j>0;j--)
		{
			check=0;
			for(int i=0;i<e;i++)
			{
				check+=kol[i]/j;
			}
			if(check>=n)
			{
				possible=j;
				break;
			}

		}
		cout << possible;
	}
	return 0;
}

#include<bits/stdc++.h>
#define fr(i,n) for(i=0;i<n;i++)
#define loop() int t;cin>>t;while(t--)
#define ll long long
using namespace std;

int main()
{
    ll c,i,p,k;
    int n,start,end;
   loop()
   {
       p=1;
       cin>>n>>k;
       ll a[n];

       c=0;

       fr(i,n)
       {
           cin>>a[i];
       }

       for(start=0,end=0;end<n;end++)
       {
           p=p*a[end];

           while(start<end && p>=k)
           p=p/a[start++];

           if(p<k)
           {
              c+=(end-start)+1;
            }
       }

       cout<<c<<endl;
   }
}

#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
int n,m,a[110];
int f[105];
int ans;
bool cmp(int a,int b){
    return a>b;
}
int main()
{
    ios::sync_with_stdio(false);
    while(cin>>n>>m){
        memset(f,0,sizeof(f));
        int sum = 0,cnt = 0;
        if(m<n){
            cout<<"0"<<endl;
            continue;
        }
        if(m/n==1){
            cout<<"1"<<endl;
            continue;
        }
        for(int i=0;i<m;i++){
            cin>>a[i];
            if(!f[a[i]])cnt++;
            f[a[i]]++;
        }
        sort(f,f+101,cmp);

        for(int i=1;i<=m/n;i++){
            int k = 0;
            priority_queue<int>Q;
            while(Q.size())Q.pop();
            for(int j=0;j<cnt;j++)Q.push(f[j]);
            while(!Q.empty()){
                int xm = Q.top();
                Q.pop();
                if(k==n)break;
                if(xm<i)break;
                xm -= i;
                if(xm)
                    Q.push(xm);
                k++;
            }
            if(k==n)ans = i;
            else break;
        }
        cout<<ans<<endl;
    }
    return 0;
}

/**Made By AbdoMo007**/
/**hg;,] ]i ohw fdh**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string s;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int p,n;
    cin>>p>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    int freq[1000]={};
    for(int i=0;i<n;i++)
    {
        freq[arr[i]]++;
    }
    //cout<<freq[1]<<" "<<freq[2]<<" "<<freq[3]<<" "<<freq[4]<<endl;
    vector<int>fr;
    int counter=0;
    if(p>n)
    {
        cout<<counter;
        return 0;
    }
    int maxi = *max_element(freq,freq+101);
    if (maxi == 1)
    {
        cout<<1;
        return 0;
    }
    for(int i=1;i<=100;i++)
    {
        if(freq[i]>0)
        {
            fr.push_back(freq[i]);
        }
    }
    int ma = -200000;
    sort(fr.begin(),fr.end());
    while(fr.size()>0)
    {
        int sum=0;
        for(int i=0;i<fr.size();i++)
        {
            sum+=fr[i];
        }
        sum/=p;
        if(min(sum,fr[0])>ma)
        {
            ma=min(sum,fr[0]);
        }
        fr.erase(fr.begin());
    }
    ma=min(ma,maxi/p*3);
    cout<<ma;
    return 0;
}

#include <bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
ll cnt[101];
using namespace std;
void solve(){
    ll n,m;
    cin>>n>>m;
    ll arr[m];
    rep(i,0,m){
        cin>>arr[i];
        cnt[arr[i]]++;
    }
    ll ans=1;
    ll k=m/n;
    if(k==0)
    {
        cout<<0<<endl;
        return;
    }
    for(ll i=k;i>1;i--)
    { int tmp=0;
    rep(j,1,101)
    {
        tmp=tmp+cnt[j]/i;
         if(tmp==n)
    {
       cout<<i<<endl;
       return ;
    }
    }
    }
    cout<<ans<<endl;;

}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
    //cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

/*
Problem:
Author:QiZhao
Data:2018-07-
Description:
Copyright  2018 QiZhao. All rights reserved.
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    cin.sync_with_stdio(false);
    int n,m;
    cin>>n>>m;
    int arr[102];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<m;i++)
    {
        int a;
        cin>>a;
        arr[a]++;
    }
    if(n>m)
        cout<<0<<endl;
    else
    {
        int MAX=-0xffff;

        for(int i=1;i<101;i++)
        {
            if(arr[i]>MAX)
                MAX=arr[i];
        }
        int ans=0;
        bool flag=false;
        for(int i=MAX;i>0;i--)
        {
            if(flag==true)
                break;
            int cnt=0;
            for(int j=0;j<101;j++)
            {
                if(arr[j]>=i)
                {
                    cnt+=arr[j]/i;
                }
                else
                    continue;
                if(cnt==i)
                {
                    ans=i;
                    flag=true;
                    break;
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int n, m, a[105], b[105];

int main() {
	cin >> n >> m;
	for (int i = 1; i <= m; i++){
		cin >> a[i];
	}
	for (int i = 1; i <= m; i++){
		int s = 0, z = 0;
		for (int j = i; j <= m; j++){
			if (s < a[j]){
				s = a[j];
				z = j;
			}
		}
		a[z] = a[i];
		a[i] = s;
	}
	int g = 1;
	for (int i = 1; i <= m; i++){
		if (i == 1){
			b[g]++;
		}
		else{
			if (a[i] == a[i - 1]){
				b[g]++;
			}
			else{
				g++;
				b[g]++;
			}
		}
	}
	for (int i = 1; i <= g; i++){
		int s = 0, z = 0;
		for (int j = i; j <= g; j++){
			if (s < b[j]){
				s = b[j];
				z = j;
			}
		}
		b[z] = b[i];
		b[i] = s;
	}
	int v = 0;
	for (int i = 1; i <= g; i++){
		v += b[i];
	}
	if (n > v){
		cout << 0 << endl;
		return(0);
	}
	int ans = 0;
	for (int i =  v/n-1; i >= 1; i--){
		for (int j = 1; j <= g; j++){
			ans += (b[j] / i);
		}
		if (ans >= n){
			cout << i << endl;
			return(0);
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
#define sz 100000
#define ff first
#define ss second
#define pi acos(-1.0)
#define ll long long
#define all(a) a.begin(),a.end()
#define mem(a,v) memset((a), v, sizeof(a))
#define faster   ios_base::sync_with_stdio(0);cin.tie(0);

#define pb()   pushback()
map<int,int>mp;
set<int>st;
int main()
{
    faster
    int n,t,x,s(0);
    cin>>n>>t;
    for(int i=0;i<t;i++)
        cin>>x,mp[x]++,s+=x;
    if(s<n)
        cout<<"0\n";
    else
    {
        int mx(0),sum,w;
        for(auto i: mp)
        {
            sum=0;
            for(auto j:mp){
                w=(j.ss / i.ss);
                sum=sum+(w*i.ss);
            }
            //cout<<sum<<'*';
            sum/=n;
            if(sum>=1)
                mx=max(mx,sum);
        }
        cout<<mx<<'\n';
    }
    return 0;
}

//�����
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef double db;
const int MOD = 1000000007;
const ll INF = 1000000000000000007;
const double EPS = 1e-9;
const int sz = 0;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb push_back

int ar[100];

bool cmp(int a, int b) {
	return a > b;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif // DEBUG

	int n, m;
	cin >> n >> m;
	if (n > m) {
		cout << 0;
		return 0;
	}
	for (int i = 0; i < m; ++i) {
		int a;
		cin >> a;
		ar[a - 1]++;
	}

	sort(ar, ar + 100, cmp);

	int mx = 0;
	for (int i = 1; i < m; ++i) {
		int cnt = 0;
		for (int j = 0; j < m; ++j) {
			cnt += ar[j] / i;
		}
		if (cnt >= n)
			mx = i;
		cnt = 0;
	}

	cout << mx;
}

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
using namespace std;
#define ios1 std::ios::sync_with_stdio(false)
#define ios2 std::cin.tie(0)
#define inf 0x3f3f3f3f
#define ll long long
#define met(a,b) memset(a,b,sizeof(a)
const int maxn = 2e5+6;

struct node
{
    int x,num;
} gj[200];

bool cmp(node a,node b)
{
    return a.num<b.num;
}

int main()
{
    ios1;
    ios2;
    int n,m;
    cin>>n>>m;
    int c=0;
    for(int i=0; i<m; i++)
    {
        int x,f=0;
        cin>>x;
        for(int j=0; j<c; ++j)
        {
            if(x==gj[j].x) gj[j].num++,f=1;
        }
        if(!f) gj[c].x=x,gj[c++].num=1;
    }
    if(m<n)
    {
        cout<<0<<endl;
        return 0;
    }

    sort(gj,gj+c,cmp);
    int ans=m/n,an=0,f=0,i,j;
    for( j=ans; j>0; j--)
    {
        for( i=0; i<c; i++)
        {
            an+=gj[i].num/j;

        }
        if(an>=ans){
                break;
               f=1;
        }

    }
      cout<<j<<endl;;
        return 0;
    }