Little Y is a college student who is currently doing researches related to strings. Little Y learned about the following definitions regarding strings:
After understanding the above definitions, Little Y came up with the following problem:
Given a string $s[1 : n]$ of length $n$, there are $q$ queries, each query giving two parameters $i$ and $r$. You need to find out how many values of $l$ satisfy the following conditions:
Little Y would like to ask for your help in solving this problem.
This problem has multiple test data sets.
The first line of the input contains two integers $c $ and $t$, which represent the test case number and the number of test data sets. $c = 0$ represents that this test case is a sample test.
Then, each set of test data is given as input in order. For each set of test data:
The first line of input contains two positive integers, $n$ and $q$, which represent the length of the string and the number of queries respectively.
The second line of input contains a string $s$ of length $n$ that only consists of lowercase letters.
Then $q$ lines follow, each containing two positive integers, $i$ and $r$, representing a query. It is guaranteed that $i+2r -1 \leq n$.
For each query of each set of test data, output a line containing an integer, representing the number of $l$s satisfying the requirements.
For all test data, it is guaranteed that: $1 \leq t\leq 5,1\leq n\leq 10^5,1\leq q\leq 10^5,1\leq i+2r-1\leq n$. The string $s$ only consists of lowercase letters.