PROBLEM STATEMENT
You will be given a vector a and two ints lower and upper. Return the number of integers
between lower and upper, inclusive, that are multiples of all members of a.
DEFINITION
Class:CommonMultiples
Method:countCommMult
Parameters:vector , int, int
Returns:int
Method signature:int countCommMult(vector a, int lower, int upper)
CONSTRAINTS
-a will contain between 1 and 50 elements, inclusive.
-Each element of a will be between 1 and 100, inclusive.
-upper will be between 1 and 2000000000 (2*109), inclusive.
-lower will be between 1 and upper, inclusive.
EXAMPLES
0)
{1,2,3}
5
15
Returns: 2
The only numbers between 5 and 15 that are multiples of 1, 2 and 3 are 6 and 12.
1)
{1,2,4,8,16,32,64}
128
128
Returns: 1
128 is a multiple of all smaller powers of 2.
2)
{2,3,5,7,11,13,17,19,23,29,31,37,41,43,49}
1
2000000000
Returns: 0
3)
{1,1,1}
1
2000000000
Returns: 2000000000
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.