In Rudolandia, foxes are celebrating Coding Day!
This year, they received two binary strings and of length . They decided to check how many errors occurred while transporting these strings.
Let the error in comparing two binary strings and be the number of subsegments on which, for all elements, a_i \ne b_i.
To verify this, they decided to compare all cyclic shifts of the string with the string . The minimum error among all possible shifts was taken as the transportation error.
Help them find the transportation error.
The first line contains an integer (1 \le t \le 100) — the number of test cases.
Each test case consists of three lines.
The first line of a test case contains an integer (1 \le n \le 4 \cdot 10^3) — the length of the strings and .
The second line of a test case contains the string (0 \le s_i \le 1, |s| = n).
The third line of a test case contains the string (0 \le g_i \le 1, |g| = n).
It is guaranteed that the sum of over all test cases does not exceed 4 \cdot 10^3.
For each test case, output an integer — the number of errors that occurred during transportation.
Example 1
For the first test case:
The minimum transportation error can be achieved with a cyclic shift of the string g = 01110. Then the error is equal to because there exists a substring .
Subtask ( points): (n \le 10, the sum of all does not exceed
Subtask ( points): No additional constraints