spoj#HABLU. Hablu and Bablu
Hablu and Bablu
Hablu is a hardworking programmer. He solves lots of easy problems everyday :P. Hablu's teammate Bablu is busy with studies, so amount of solved by him is smaller than Hablu's.
Their coach NannaMia noticed the fact that the number of solved problems by Hablu is a multiple of number of solved problems by Bablu.
Then NannaMia asked Hablu a question. Giving a collection of integers S, NannaMia said that the number of solved problems by Bablu is not a multiple of any integer contained in S (S only contains primes or 1). How many valid integers are there which could be the number of problems solved by Bablu.
As Hablu solves only easy problems, he is unable to solve this one. So, you need to help him :)
Input
The first line contains t, number of test cases (t<=1500).
Each case starts with an integer H, the number of problems solved by Hablu and K, the size of the collection S. The next line contains K space separated integers (the members of S).
Remember that the online judge in which they solve has only(!) 1012 problems. So no number will be greater than 1012. And K will be between 0 and 500.
Output
Print a line for each test case containing the number of possible integers which can be the number of solved problems by Bablu.
Example
Input:
1
58 2
2 3
Output:
2
Note : May be it's impossible to pass the time limit in several languages.