#433. Forgiving Matching

Forgiving Matching

Description

Little Q is now checking whether string AA matches BB. Two strings are considered matched if they have the same length, and there is no position ii that AiA_i is different from BiB_i.

However, Little Q is a kind man, he forgives every person who hurt him. What's more, he even forgives strings! He gives the string kk opportunities, if there are no more than kk positions ii that AiA_i is different from BiB_i, then Little Q will also consider the two strings matched. Note that both of the strings may contain the wildcard character '*\texttt{*}', which can match exactly one any character, in such a case this pair won't consume the forgiveness opportunities.

Let's denote occ(S,T)occ(S,T) as the number of substrings in string SS which matches TT, two substrings are considered different if they start in different places. You will be given two strings SS and TT, write a program to compute the value of occ(S,T)occ(S,T) for k=0,1,2,,Tk=0,1,2,\dots,|T|.

Format

Input

The first line contains a single integer KK (1K1001 \leq K \leq 100), the number of test cases. For each test case:

The first line of the input contains two integers nn and mm (1mn2000001 \leq m\leq n \leq 200\,000), denoting the length of SS and the length of TT.

The second line contains a string SS of length nn.

The third line contains a string TT of length mm.

It is guaranteed that the sum of all nn is at most 10000001\,000\,000. Both SS and TT can only contain the characters in {\{'0\texttt{0}', '1\texttt{1}', '2\texttt{2}', '3\texttt{3}', '4\texttt{4}', '5\texttt{5}', '6\texttt{6}', '7\texttt{7}', '8\texttt{8}', '9\texttt{9}', '*\texttt{*}'}\}.

Output

For each test case, output m+1m+1 lines, the ii-th (1im+11\leq i\leq m+1) of which containing an integer, denoting the value of occ(S,T)occ(S,T) when k=i1k=i-1.

Samples

1
5 3
012*4
1*3
1
1
3
3