Easy

35.71%

Given two strings of lower alphabet characters, we need to find the number of ways to insert a character in the first string such that length of LCS of both strings increases by one.

**Input:**

The first line of the contains T denoting the number of testcases. Then T testcases follow. The first line of each test case contains integers N and M denoting the length of strings str1 and str2.

The second line of each test case contains the strings str1 and str2 consisiting of only lower case alphabets.

**Output:**

Print the answer for each test case in a new line.

**Constraints:**

1<= T <=100

1<= N, M <=100

**Example:**

**Input:**

1

5 3

abab abc

**Output:**

3