You are given types of blocks.
There are blocks of the type .
You have to make groups of size , such that no group has more than blocks of the same type.
Find the maximum number of groups that you can make.
Input Format:
The first line of each test case contains two space separated integers and which denotes the length of the array and the size of the group.
The second line of each test case contains space separated positive integers, denoting elements of array
Output Format:
Constraints:
In the first test case:-
There are 2 types of blocks and the size of group that you have to make is also 2;
so each group can have maximum = 2/2=1 block of each type.
As we have 3 blocks of each type say type 1 and type 2.
we can make maximum 3 groups.
Here is an example of how you can create the three groups:-
group 1 - 1 block of type 1 and 1 block of type 2.
group 2 - 1 block of type 1 and 1 block of type 2.
group 3 - 1 block of type 1 and 1 block of type 2.
In the second test case:-
The size of the group is 7 and we cannot take more than floor(7/2)=3 blocks of the same type in a group.
so we can form maximum 5 groups satisfying the constraints.
One way to make the 5 groups is as follows:-
1112223 , 1112223, 2223334, 2333444, 3334445
Here i represents the block of type i ( for example 1 represents block of type 1).