[Solution] Distinct Colors CodeChef Solution
Problem
There are different types of colours numbered from to . Chef has balls having colour , .
Chef will arrange some boxes and put each ball in exactly one of those boxes.
Find the minimum number of boxes Chef needs so that no box contains two balls of same colour.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases. The description of the test cases follows.
- The first line of each test case contains a single integer , denoting the number of colors.
- The second line of each test case contains space-separated integers — denoting the number of balls having colour .
Output Format
For each test case, output the minimum number of boxes required so that no box contains two balls of same colour.
Explanation:
Test case : Chef needs at least boxes such that no box has two balls of same colour. A possible configuration of the boxes would be where the element of this set denotes the colour of balls in the box.
Test case : Chef needs at least boxes such that no box has two balls of same colour.
Test case : Chef needs at least boxes such that no box has two balls of same colour. A possible configuration of the boxes would be where the element of this set denotes the colour of balls in the box.
No comments:
Post a Comment