# The number of the biscuit packages and the number of days the expedition can last….[Cprogm]FTC

Kalpana Chawla is planning an expedition to Jupiter for π people. One of the important tasks is to provide biscuits for each participant.
The warehouse has π daily biscuit packages. Each package has some biscuits type ππ.

Each participant must eat exactly one biscuit package each day. Due to extreme loads, each participant must eat the same biscuit type throughout the expedition. Different participants may eat different (or the same) types of biscuits.

Formally, for each participant π Kalpana Chawla should select the biscuit type ππ and each day π-th participant will eat one biscuit package of type ππ. The values ππ for different participants may be different.

``````Input:
The first line contains two integers π and π β the number of the expedition participants and the number of the daily biscuit packages available.

The second line contains a sequence of integers π1,π2,β¦,ππ, where ππ is the type of π-th biscuit package.

Output:
Print the output, the number of days the expedition can last. If it is not possible to plan the expedition for even one day, print 0``````
```#include<stdio.h>
#include<stdlib.h>
int cmpfunc(const void *a,const void *b){
return(*(int*)b-*(int*)a);
}
int main()
{
int a[101]={0},n,m,num,ans=0,i,day;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d",&num);
a[num]++;
}
qsort(a,101,sizeof(int),cmpfunc);
for( day=1;day<=100;day++){
num=0;
for(i=0;a[i]!=0;i++){
num+=(a[i]/day);
}
if(num>=n)
ans=day;
}
printf("%d",ans);
return 0;
}```

INPUT_1:
4Β  8
2Β  1Β  1Β  1Β  2Β  5Β  7Β  2

OUTPUT:
1

INPUT_2:
2Β  5
5Β  4Β  3Β  2Β  1

OUTPUT:
1

ILLUSTRATION