


The first line of input contains an integer 'T' denoting the number of test cases.
The first line of the test case contains 'n' and 'k' denoting the number of carrots and rabbits.
The next line contains 'k' space-separated integers denoting the jumping factor of the rabbits.
Return a single integer representing the number of remaining carrots.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= 'T' <= 50
1 <= 'n', 'k' <= 3000
1 <= A[ j ] <= n, for all j from 1 to k
Time Limit: 1 second
Explanation:
The main idea is to traverse all multiples of A[j] for all j from 1 to k. After traversing the total number of left carrots will be the answer.
Algorithm :
Explanation:
The main idea is to traverse all multiples of A[j] for all j from 1 to k. If a particular A[j] have been traversed then we don’t need to traverse its multiples(When A[j] have been traversed it means it has been multiple of some jumping factor of any rabbit. Hence all the multiples of A[j] have been the multiples of the same jumping factor of rabbit).
Algorithm: