Chef has two strings
and consisting of lowercase alphabets, each of length . Help Chef in finding the number of indices such that .
- denotes the suffix of string starting at index , i.e. .
- String String denotes that is lexicographically smaller than . If two strings and have the same length , we say that is lexicographically smaller than if there exists an index such that and . For example, "" is lexicographically smaller than "", "", but not smaller than "", "".
Input Format
- The first line contains denoting the number of test cases. Then the test cases follow.
- The first line of each test case contains , denoting the length of the strings and .
- The second line of each test case contains the string .
- The third line of each test case contains the string .
Output Format
For each test case, print a single line containing one integer - the number of indices such that .
Constraints
- The sum of over all test cases does not exceed
Sample Input 1
2
2
ab
bb
3
aaa
aab
Sample Output 1
1
3
Explanation
Test Case :
- For , "", "" and lexicographically, "" "".
- For , "", "" and lexicographically, "" "".
Test Case : For each , .
ConversionConversion EmoticonEmoticon