Zeroes and Ones

Invert two adjacent characters of either of two binary strings to make them equal, using the fewest operations, or report -1.

Medium6MathStringGreedyImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Peter did not hand in his homework for today's computer science lesson, so he was punished with an extra task. The teacher wrote two strings of the same length on the blackboard and told Peter to make them equal using operations of only one type. One operation picks one of the two strings and inverts two adjacent characters of it. Inversion turns 0 into 1 and 1 into 0.

To make the task harder, the teacher also requires the number of operations to be minimal.

For example, if the two strings are 0101 and 1111, you can invert the two middle characters of the first string to get 0011 and 1111, then invert the first two characters of the second string to get 0011 and 0011. Other ways to finish in the same number of operations exist.

Solve Peter's task for him.

Input

The input contains several test cases. The first line contains the number of test cases tt (1t1001 \le t \le 100).

Each test case is given as follows. The first line contains the length nn (1n1051 \le n \le 10^5) of the strings written by the teacher. The second and the third lines each contain one string. Both strings have length nn and consist of the characters 0 and 1 only.

The sum of nn over all test cases in one input does not exceed 10510^5.

Output

For each test case, print on one line the minimal number of operations needed to make the two strings equal. Print -1 if the strings cannot be made equal.