PROBLEM STATEMENT
You are given the results of a sociological survey containing several questions. Each participant
was required to answer each question with an integer between 0 and 10, inclusive. You are given
the average answer for each question, but the decimal portion of each average is truncated after
the first three digits. For example, if there were three participants and their answers to a
particular question were 4, 6 and 10, the average for that question would be given to you as 6.666.
You are given a vector marks. Each element of marks is a single space delimited list of
numbers. Each number in marks is the average answer for a survey question. Return the minimum
possible number of participants that could have taken this survey.
DEFINITION
Class:AverageProblem
Method:numberOfParticipants
Parameters:vector
Returns:int
Method signature:int numberOfParticipants(vector marks)
CONSTRAINTS
-marks will contain between 1 and 50 elements, inclusive.
-Each element of marks will contain between 5 and 50 characters, inclusive.
-Each element of marks will be a single space separated list of numbers, where each number is
between 0 and 10, inclusive, contains no extra leading zeroes, and contains exactly one decimal
point followed by exactly 3 digits.
-marks will contain between 1 and 50 numbers, inclusive.
EXAMPLES
0)
{"0.000"}
Returns: 1
There will always be at least one participant. In this case, the smallest number of participants
that could have produced this result is 1.
1)
{"0.500 0.250", "0.125"}
Returns: 8
2)
{"0.500","0.300"}
Returns: 10
3)
{"0.500","0.301"}
Returns: 106
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.