Given an array arr of N elements and Q queries . Each query consists of two integers L and R . You task is to find the number of elements of arr in range [L,R] which occur atleast K times.
First line of input consist of a single integer T denoting the total number of test case. First line of test case contains three space separated integers N,Q and K. Second line of test case contains N space separated integers denoting the array arr. Third line of test case contains Q pairs of integers Li and Ri denoting Q queries.
For each test case output a single line consisting of Q integers , representing the answer to each query
5 2 1
1 1 2 1 3
1 5 2 4
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.