You're given a string S of length N consisting of lowercase English letters. You are asked Q queries of the type L R. For each query, you are asked to find the no of good substrings between L to R (inclusive).
A substring will be called good if it has no inversions. If there exists any pair of indices (i,j) in the substring a where, i<j for which ai>aj (according to the alphabetical order of the letters) then this pair is counted as an inversion.
A substring of a string is a continuous segment of letters from the string. For example, "acker" is a substring of "hackerearth" and "ckar" is not. The length of the substring is the number of letters in it.
Input format
Output format
For each test case, for each ith query, print a single integer denoting the answer to the ith query.
Constraints
1≤T≤101≤N,Q≤2⋅1051≤L≤R≤NS contains lowercase English letters