Given a sequence $A_1, A_2, \ldots, A_N$ of length $N$ and an integer $K$. Write a program to execute the following query:
l r: output the number of pairs $(i, j)$ satisfying $l \le i < j \le r$ and $\mathrm{abs}(A_i - A_j) \le K$.
Input
The first line contains two integers $N$ $(1 \le N \le 100{,}000)$ and $K$ $(1 \le K \le 100{,}000)$, representing the length of the sequence and the parameter $K$.
The second line contains $N$ integers $A_1, A_2, \ldots, A_N$ $(1 \le A_i \le 100{,}000)$.
The third line contains an integer $M$ $(1 \le M \le 100{,}000)$, representing the number of queries.
The next $M$ lines each contain two integers $l, r$ $(1 \le l \le r \le N)$, representing a query.
Output
For each query, output a line containing a single integer representing the answer.
Examples
Input 1
4 31 1 16 32 64 4 1 4 1 2 2 4 2 3
Output 1
3 1 1 1