An array containing n elements is given. Find number of distinct contiguous subsegments of length l, each containing at least k different elements. If you sort any two segments of length l, and ai=bi,1≤i≤l, then both the segments are considered to be same, and is counted only once.
Input
First line contains two space seperated integers n and q, size of array and number of queries respectively.
Next line contains n space seperated integers.
Next q lines contains two space separated integers lk, l is the size of subsegment and k is the number of distinct elements in each subsegment.
Output
For each query print on a new line, the number of distinct contiguos subsegments of length l, each of which contains at least k different elements.
Constraints
1≤n≤105
1≤ai≤105
1≤q≤100
1≤k≤n
1≤l≤109
The seven different contigous segments are [1,3],[4,6],[5,7],[6,8],[7,9],[8,10],[9,11].
After sorting all seven segments mentioned above,
1,1,2
1,2,2
2,2,3
2,3,3
3,3,4
3,4,5
4,5,5
It is clear than all the above segments are distinct. Also all segments contains atleast 2 distinct elements.