Maximum number of distinct groups
There are n different types of items, each with a count of c[i] (where 1 <i<n).
You are given a value k and your task is to determine the maximum number of distinct groups of size k that can
be formed using the given items. A group of size k is said to be distinct if all the k items of the group are
of different types
Input format
The first line consists of a single integer t denoting the total number of test cases
• The first line of each test case consists of two space-separated integers n and k respectively
The second line of each test case consists of 12 space-separated integers each denoting the count of the
ith type of item
Answers
Answered by
0
Answer:
For example, given an array {2,4,2,4,3,2,3}, distinct array is {2,3,4}. So, 2 such groups are possible for the given array. Another example, for {1,2,1,3,4,4,3,3}, distinct array is {1,2,3,4} and only 1 such group can be formed from the given array.
Answered by
3
Bhai cheating se kuch ni hoga!
Similar questions
Math,
3 months ago
World Languages,
3 months ago
Math,
3 months ago
Political Science,
7 months ago
Physics,
11 months ago
Math,
11 months ago