GitHub repository: DJasmineJoyline/ColorGame
Primary language: C
Created: 2020-04-27T08:31:03Z
Description: Color Game     The pre-school teacher Rita is very popular among the nursery kids as she is quite friendly and as she teaches all the lessons through some interesting games.     Rita usually takes attendance at the end of the class.     In a nursery class, Rita wanted to inroduce the children to different colors. As the children are not familiar with the color names, she thought of conducting a game through which children would be able to learn to identify similar colors.     She would ask the question "How many children in this class other than yourself is wearing the dress with same color as your's?" to the children in a random way. The children all replied truthfully, and no child was asked the question more than once.     Rita notes down the answers of all children. She was so much immersed in the game that she didn't notice the time and the bell rang.     She didn't take attendance. Can you please help Rita in finding the minimum number of children in her class on that day based on the information she has noted down?     Input Format:     The first line of the input consists of an integer, n that corresponds to the number of children whom Rita questioned.  The second line of the input consists of 'n' space separated integers that corresponds to the answers provided by the 'n' children.  Assume that the maximum value of n is 20.     Output Format:  Output consists of an integer that corresponds to the minimum possible number of children present in the class.     Sample Input 1:  4  1  1  2  2     Sample Output 1:  5     Sample Input 2:  4  1  1  2  3     Sample Output 2:  9     Sample Input 3:  9  2  2  44  2  2  2  444  2  2     Sample Output 3:  499  Sample Input 4: 2 0 0  Sample Output 4: 2