As our mighty hero Sin is in pursuit of the wicked wizard,what he faces ahead is the land of mines .
In order to cross the land of mines Sin needs to disarm all the mines in his path.Individual mine contained an array of integers and a separate individual integer k written on it and a space above which "key" is written.
In order to diffuse a mine Sin needs to find key.The key to diffuse the bomb resides in the array written on individual mines.
To diffuse a mine Sin needs to find the count of all the sub arrays which contains k or more than k similar elements.
Since Sin is weak at calculations help Sin calculate the key in order to diffuse individual mine.
Contraints
1<=t<=1000
1<=n<=105
1<=ai<=109
1<=k<=105
Input
First line contains integer t denoting number of testcases , Next t testcases contains :
FIrst line contains integer n (size of array ) and k
Second line contains array of integers.
Output
for every testcase , output no. of subarrays.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
No editorial available for this problem.