Given an array of integers A and a target value target.
Find whether there exists a subset in the array A where their sum is equal to target.
A: [1, 3, 4, 9, 2]
target: 13
Result: Subset exists.
Subset [1, 3, 9] has a sum equal to 13.
The first line contains an integer ‘T’, denoting the number of test cases.
For each test case the input has three lines:
A.A.For each test case, the output has a line with 1 or 0 depending on whether the subset exists or not respectively.
2
5
1 1 2 3 4
5
5
1 3 1 3 4
20
1
0
1 <= T <= 100
1 <= n <= 16
1 <= Ai <= 500
1 <= target <= 500