Sam is playing with an array, , of positive integers. Sam writes a list, , containing all 's contiguous subarrays, and then replaces each subarray with its respective maximum element.
For example, consider the following where :
Subarrays of :
Updated (Maximum) Subarrays:
Help Sam determine how many numbers in are greater than .
The first line contains a single integer, (the number of test cases). Each test case is described over two lines:
The first line of each test case contains two space-separated integers, (the number of elements in array ) and , respectively.
The second line of each test case contains space-separated integers describing the elements in .
For each test case, print the number of in on a new line.
1 2 3
1 2 3
Both test cases use the same as described in the Problem Statement, so for both test cases.