

You are given three arrays X, Y and Z of size A,B and C respectively.Also, all three arrays are sorted in non-decreasing order. Find i, j, k such that : 0 <= i < A, 0 <= j < B, 0 <= k < C and max(abs(X[i] - Y[j]), abs(Y[j] - Z[k]), abs(Z[k] - X[i])) is minimized. Your task is to return the minimum of all the max(abs(X[i] - Y[j]), abs(Y[j] - Z[k]), abs(Z[k] - X[i]))
Note:1. All the arrays are sorted in non-decreasing order.
2. abs(x) denotes the absolute value of x, i.e. if x<0, the abs function returns (-x) so that the final value of x becomes positive.
The first line of the input contains an integer T, denoting the number of test cases.
The first line of each test case contains the integer A, denoting the size of the X array.
The second line of each test case contains A space-separated integers denoting the array X elements.
The third line of each test case contains the integer B, denoting the size of the Y array.
The fourth line of each test case contains B space-separated integers denoting the array Y elements.
The fifth line of each test case contains the integer C, denoting the size of the Z array.
The sixth line of each test case contains C space-separated integers denoting the array Z elements.
Output Format:
For each test case, every line of output prints the minimum of the above condition.
Note :
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= A,B,C <= 10^4
1 <= X[i] <= 10^4
1 <= Y[i] <= 10^4
1 <= Z[i] <= 10^4
Time Limit: 1 sec
1
5
1 2 3 4 5
5
1 3 5 7 9
3
2 4 6
1
For firstestcase :
One of the possible answer is choose i = 0, j = 0 and k = 1.
Thus it will 1 answer.
1
4
1 1 1 1
4
2 2 2 2
5
7 7 7 7 7
6
Try the simplest possible way.
O(N^3), where N is the number of elements in the array.
O(1), as we are using constant extra memory.