For this Question: Given an array A of size N. Find the number of pairs of elements in this array such that their sum is <b>at least L</b> and <b>at most R</b>. More formally, find the count of pairs of indices i and j such that 1 <= i < j <= N and <b>L <= A<sub>i</sub> + A<sub>j</sub> <= R</b>.First line contains a single integer N.
The second line of the input contains two integers L and R.
The third line of the input contains N space seperated integers.

Constraints:
2 <= N <= 10<sup>5</sup>
1 <= L <= R <= 10<sup>9</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Print the count of pairs of elements in the array such that their sum is at least L and at most R.Sample Input:
5 5 8
5 1 2 4 3

Sample Output:
7

Explaination:
The pairs of indices are as follows:
(1, 2) -> 5 + 1 = 6
(1, 3) -> 5 + 2 = 7
(1, 5) -> 5 + 3 = 8
(2, 4) -> 1 + 4 = 5
(3, 4) -> 2 + 4 = 6
(3, 5) -> 2 + 3 = 5
(4, 5) -> 4 + 3 = 7
All these sums are within range [L, R]., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static long countOfPairs(int [] A, int N, int K) {
        long count = 0;
        int i = 0;
		int j = N-1;
        while( i<j ) {
            if((A[i] + A[j]) > K) {
				j--;
			}
			else{
				count +=(j-i);
				i++;
			}
		}
		return count;
    }
    public static void main (String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int L, R;
        L = input.nextInt();
        R = input.nextInt();
        int [] A = new int[N];
        for(int i=0; i<N; i++) {
            A[i] = input.nextInt();
        }

        Arrays.sort(A);
		long countL = countOfPairs(A, N, L-1);
		long countR = countOfPairs(A, N, R);

		System.out.println(Math.abs(countL - countR));
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?