My flatmate, Sayan, once invited all his relatives and friends from all over the city to join him on his birthday party. He is also famous for boasting that all his friends and relatives belong to "proper" families. Now, he appointed a gaurd to allow only his relatives and friends into the party. It is gauranteed that all the relatives and friends come with their families all at once ,i.e, all members belonging to the same family reach all at once. Now gaurd's task is to count the number of "proper" families who came in the party. All families have a unique "special number" assigned to them ,i.e., all members of the same family share the same "special number". A family is said to be proper only if the number of members in the familiy is a number which can be made by adding numbers from a given set of "valid" numbers N. Further constraint is that each valid number can be used only once.
Take an example:-
if N={1,2,8} then all the families with 1,2,3,8,9,10 , or 11 members are allowed in the party , where as families with 4,5,6,7, etc members are not allowed.
The gaurd being a lazy fellow came to you for help.You need to write a program that computes the number of "proper families" in who turned up.
INPUT.
First line of input contains a number T denoting the number of test cases.T test cases follow. In each test case, the first line contains the number(P) of total number of people coming for the party and the number (M) denoting the number of "valid" numbers. The 2nd line contains M numbers, the set N ,containing all distinct "valid" numbers separated with spaces. The 3rd line contains P numbers, the "special" number of the members separated with spaces.
OUTPUT.
Output a single line for each of the test cases that denotes the number of "proper families" who turned up for the party.
CONSTRAINTS:
1<=T<=5
1<=P,N,M<=1000
In the first case: Clearly, The families with 1,2,3,8,9,10 and 11 members are allowed in the party. The family with "Special" number 2 has 3 members in it which is allowed.Same for the family with "special" number 3. But for the family with "special" number 4 has 4 members, which is not allowed. So the total number of "proper" families = 2.