import java.util.*; import java.lang.*; import java.io.*; //https://www.geeksforgeeks.org/two-pointers-technique/ class TwoPointersAlgo { //This function prints all pairs in the array that sum to a number X. If no such pair exists then output will be -1. static void twoSum(int A[], int X) { Arrays.sort(A); //Array sorting is necessary for this algo to function correctly int n = A.length; int i = 0, j = n-1, flag=0; //Implementation of the algorithm starts while(i0) { t--; n = in.nextInt(); int a[] = new int[n]; for(int i = 0; i