


An integer 'a' is closer to 'X' than an integer 'b' if:
|a - X| < |b - X| or ( |a - X| == |b - X| and a < b )
if X = 4, 3 is closer to 'X' than 9, as |3-4| < |9-4| i.e., 1 < 5 and if X = 4, 2 and 6 are equally close to it, as |2-4| == |6-4| = 2, but we say 2 is closer to 4 than 6, as 2 is smaller.
The first line of the input contains ‘T’ denoting the number of test cases.
The first line of each test case contains the three integers 'N', 'K', and 'X'.
The second line of each test case contains 'N' space-separated integers of the array 'A'.
Return the k space-separated integers.
The output of each test case is printed on a new line.
1 <= T <= 5
1 <= N, K <= 5000
1 <= A[i], X <=10^6
Time Limit: 1 second
Explanation:
Algorithm:
The key idea is that we know that the final answer will be some contiguous sequence in array ‘A’. So we initially take the complete array as our answer then reduce its range.
Algorithm: