Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers which evaluate to a number divisible by M.
The first line contains T, the number of test cases.For each test case, the first line contains an integer n denoting the size of the array A. Next line contains n-space separated integers and next line contains an integer m denoting the number from which divisibility needs to be checked.
For each test case, the output is 1 if divisible else 0.
1<=m<=10 Note: Sum of elements should be less than 1000.