DreamGrid has just found two binary sequences and ( for all ) from his virtual machine! He would like to perform the operation described below exactly twice, so that holds for all after the two operations.
The operation is: Select two integers and (), change to for all .
DreamGrid would like to know the number of ways to do so.
We use the following rules to determine whether two ways are different:
Let , where , be a valid operation pair denoting that DreamGrid selects integers and for the first operation and integers and for the second operation;
Let , where , be another valid operation pair denoting that DreamGrid selects integers and for the first operation and integers and for the second operation.
and are considered different, if there exists an integer () such that .
输入格式
There are multiple test cases. The first line of the input contains an integer , indicating the number of test cases. For each test case:
The first line contains an integer (), indicating the length of two binary sequences.
The second line contains a string () of length , indicating the first binary sequence.
The third line contains a string () of length , indicating the second binary sequence.
It's guaranteed that the sum of in all test cases will not exceed .
输出格式
For each test case, output an integer denoting the answer.
样例
样例输入 1
3
1
1
0
2
00
11
5
01010
00111
样例输出 1
0
2
6
数据范围与提示
For the second sample test case, there are two valid operation pairs: and .
For the third sample test case, there are six valid operation pairs: , , , , and .