Given an sorted array A of size N. Find number of elements which are less than or equal to given element X.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each testcase contains 3 lines of input. The first line contains an integer N denoting the size of the array. Then the next line contains N space separated integers forming the array. The third line contains an element X.
For each testcase, in a new line, print the number of elements which are less than or equal to given element.
1 <= T <= 105
1 <= N <= 105
1 <= Ai <= 105
0 <= X <= 105
1 2 4 5 8 10
1 2 2 2 5 7 9
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.