Consider the array . It is interesting for several reasons. The first five numbers are divisible by , and after that no number is divisible by . The first ten numbers are even, and after that all are odd. The first eight numbers are divisible by , and after that none is. Arrays like this one have a special property: for certain divisors, the numbers divisible by the divisor come first, followed only by numbers that are not.
You are given such an array and divisors. For every divisor it is guaranteed (no need to check) that the elements divisible by it form a prefix of the array - your task is to determine, for each divisor, how many elements are divisible by it.
Input
The first line contains a single integer - the number of testcases.
- The first line of each testcase contains two integers and - the number of elements and the number of divisors.
- The next line contains positive integers - the elements of the array.
- The next line contains positive integers - the divisors.
Output
For every divisor print a single line with the number of elements divisible by it.
Example
1 13 6 210 2310 390 30 510 66 6 138 46 106 59 17 23 10 2 6 2 4 15
5 10 8 10 0 5
The first five elements are divisible by , the first ten by , the first eight by , none by and the first five by .
Constraints
for every divisor
Both the sum of and the sum of over all testcases are at most .
This problem was adapted, with permission, from Prvi koji nije deljiv, authored by Društvo matematičara Srbije and Fondacija Petlja.