For this Question: Given an array A of size N, find the count of pairs of indices <b>i</b> and <b>j</b> such that <b>1 <= i < j <= N</b> and the <b>mean</b> of elements at these indices is at least <b>K</b>.
More formally, you have to find the number of indices <b>i</b> and <b>j</b> such that <b>1 <= i < j <= N</b> and (A<sub>i</sub> + A<sub>j</sub>)/2 >= KFirst line of the input contains two integers N and K.
The second line contains N space seperated integers A<sub>i</sub>

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= K <= 10<sup>9</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Print the number of pairs satisfying the above condition in array A.Sample Input:
5 6
4 7 8 2 5

Sample Output:
4

Explaination:
The following pairs of indices satisfy the condition (1-based indexing)
(1, 3) -> (4 + 8)/2 = 6
(2, 3) -> (7 + 8)/2 = 7.5
(2, 5) -> (7 + 5)/2 = 6
(3, 5) -> (8 + 5)/2 = 6.5
There are no more pairs of indices that satisfy the above condition., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String nk=br.readLine();
        String nkarr[]=nk.split(" ");
        int n =Integer.parseInt(nkarr[0]);
        int k =Integer.parseInt(nkarr[1]);

        String ss = br.readLine();
        String sst[]=ss.split(" ");

        int arr[]=new int[n];
        for(int i=0;i<n;i++){
            arr[i]=Integer.parseInt(sst[i]);
        }

       long val = findMean(arr,n,k);
       System.out.println(val);

    }

    public static long findMean(int []arr,int n,int k){

        Arrays.sort(arr);

        int low =0;
        int high=arr.length-1;
        long ans=0;
        while(low<high){
            long mean =(arr[low]+arr[high])/2;
            if(mean>=k){
                ans+=(high-low);
                high--;
            }else{
                low++;
            }
        }
        return ans;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?