A recent survey suggested that almost everybody knows that a palindrome is a string which reads the same backwards as forwards. Recently, Blacky invented a brand-new concept: K-palindromes. A string is called a K-palindrome if it is possible to make it a usual palindrome by replacing at most K characters. For example, a string abb can be made a palindrome by replacing one character, the second b with an a. Please note, that according to the definition, a usual palindrome is a K-palindrome for any non-negative integer K.
Blacky was walking in a garden and came across a string S of N characters. Now, he wants to know the sum of the lengths of all substrings of S which are K-palindromes. Note that two substrings are considered to be different if they cover the different ranges of indices, even if they are equal as strings.
Input
The first line of input contains an integer T denoting the number of test cases. Each of the next T lines contains a description of a separate test case.
The only line of the test case description contains two integers N and K followed by string S, all separated by single spaces. S consists of lowercase Latin characters only.
Output
For each test case, output a single line containing one integer: the answer for the test case.
Constraints
1 ≤ T ≤ 5
1 ≤ N ≤ 105
0 ≤ K ≤ 5
Sample Input 1
2
7 0 abacaba
7 1 abacaba
Sample Output 1
28
56
Explanation
Test case 1:
There are:
7 0-palindromes with length 1 (just each character)
3 0-palindromes with length 3 (aba, aca, aba)
1 0-palindrome with length 5 (bacab)
1 0-palindrome with length 7 (abacaba)
.
The total length: 71 + 33 + 15 + 71 = 28
Test case 2:
There are:
7 1-palindromes with length 1 (just each character)
6 1-palindromes with length 2 (each substring with length 2)
5 1-palindromes with length 3 (each substring with length 3)
3 1-palindromes with length 5 (abaca,bacab, acaba)
1 1-palindrome with length 7 (abacaba)
.
The total length: 71 + 62 + 53 + 53 + 7*1 = 56
medium hacktoberfest