Quadruplet Sum
medium
1. You are given an array(arr) of N integers and an integer X. 2. You have to find all unique quadruplets(a,b,c,d) which satisfies this condition - a+b+c+d = X.
Constraints
1 <= N <= 200 -10^3 <= arr[i] <= 10^3 -10^9 <= X <= 10^9
Format
Input
A number N arr1 arr2.. N numbers A number X
Output
Every line of output contains four integers which represent a quadruplet having sum X.
Example
Sample Input
6
1 0 -1 0 -2 2
0
Sample Output
-2 -1 1 2
-2 0 0 2
-1 0 0 1