For this Question: Given a sorted array of N integers a[], and Q queries. For each query, you will be given a positive integer K and your task is to print the number of elements in array a[] that are smaller than or equal to K.<b>In case of Java only</b>
<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>smallerElements()</b> that takes the array a[], integer N and integer k as arguments.

<b>Custom Input</b>
The first line of input contains a single integer N.
The second line of input contains N space- separated integers depicting the values of the array.
The third line of input contains a single integer Q, the number of queries.
Each of the next Q lines of input contain a single integer, the value of K.

<b>Constraints:-</b>
1 <= N <= 10<sup>5</sup>
1 <= K, Arr[i] <= 10<sup>12</sup>
1 <= Q <= 10<sup>4</sup>Return the count of elements smaller than or equal to K.Sample Input:-
5
2 5 6 11 15
5
2
4
8
1
16

Sample Output:-
1
1
3
0
5, I have written this Solution Code: static int smallerElements(int a[], int n, int k){
        int l=0;
    int h=n-1;
    int m;
    int ans=n;
    while(l<=h){
        m=l+h;
        m/=2;
        if(a[m]<=k){
            l=m+1;
        }
        else{
            h=m-1;
            ans=m;
        }
    }
    return ans;
}

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