Given an array A and a target value, find all unique quadruples such that their sum is equal to the target value.
Note: The resultant set must not contain any duplicate quadruplets.
A: [-1 , -3 , -2, -2, 5, 1]
Target: 2
Quadruples: [
[-1, -3, 5, 1],
[-2, -2, 5, 1]
]
The first line contains an integer ‘T’ denoting the number of test cases.
For each test case, the input has three lines:
A.A.target value.For each test case, the output has the following lines
4
5
1 2 3 4 5
11
6
1 2 3 4 5 2
10
1
5
10
10
-2 -7 1 -4 4 -5 6 8 -1 -2
-3
1
1 2 3 5
2
1 2 2 5
1 2 3 4
0
6
-7 -5 1 8
-7 -2 -2 8
-7 -1 1 4
-5 -4 -2 8
-5 -2 -2 6
-4 -2 -1 4
1 <= T <= 10
0 <= n <= 200
-108 <= Ai <= 108
-109 <= target <= 109