An array containing elements is given. Find number of distinct contiguous subsegments of length , each containing at least different elements. If you sort any two segments of length , and , then both the segments are considered to be same, and is counted only once.
Input
First line contains two space seperated integers and , size of array and number of queries respectively.
Next line contains space seperated integers.
Next lines contains two space separated integers , is the size of subsegment and 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 , each of which contains at least different elements.
Constraints
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.