Sarthak and his Set of Primes solution codechef
Sarthak has a setof distinct prime numbers. He grew very fond of that set, and now he only likes a positive integer if all of its prime factors belong to . Given the set and a positive integer , can you find out how many integers he likes which are not more than ?
Note: Sarthak always like the number.
Input Format Sarthak and his Set of Primes solution codechef
- The first line of each input contains – the number of test cases. The test cases then follow.
- The first line of each test case contains two space-separated integers and – the size of and the limit defined in the statement.
- The second line of each test case contains space-separated integers – the elements of .
For each test case, output on a single line the number of positive integers Sarthak likes that is not more than.
Sarthak and his Set of Primes solution codechef Constraints
- has distinct prime numbers
Sample Input 1
1 2 10 3 5
Sample Output 1 Sarthak and his Set of Primes solution codechef
- Test case : Sarthak likes the numbers , , and .