For this Question: Given a sorted array A having N integer elements, find if there exists any pair of elements such that (A[i], A[j]) have the sum equal to X (i < j)The first line of input contains T, denoting the number of testcases. The first line of each test case contains N size of array and X. Second line contains elements of array separated by space.

Constraints:
1 <= T <= 100
1 <= N <= 100000
1 <= X <= 1000
1 <= A[i] <= 1000000For each test case you need to print "Yes" if pair exists otherwise "No".Input:
2
5 4
1 2 3 4 5
5 6
2 3 5 7 8

Output:
Yes
No, I have written this Solution Code: import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
    
    public static void main(String args[])throws IOException
    {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(read.readLine());
        
        while(t-- > 0)
        {
            String s[] = read.readLine().trim().split("\\s+");
            
            int n = Integer.parseInt(s[0]);
            int k = Integer.parseInt(s[1]);
            
            int arr[] = new int[n];
            
            String st[] = read.readLine().trim().split("\\s+");
            
            for(int i = 0; i < n; i++)
            {
                arr[i] = Integer.parseInt(st[i]);
            }
            
            
            
            System.out.println(isPair(arr, n, k)? "Yes" : "No");
        }
    }
    static boolean isPair(int A[], int N, int X)
    {
        int i = 0; 		// represents first pointer 
	    int j = N - 1; 		// represents second pointer 
	    while (i < j) { 
		    // If we find a pair 
		    if (A[i] + A[j] == X) 
			    return true;
			else if (A[i] + A[j] < X) 
			        i++;
			else	j--; 
	} 
	return false; 
}

}, In this Programming Language: Java, Now tell me if this Code is compilable or not?