Given an integer sequence of length $n$ ($n \ge 2$), denoted as $a_{1,2,\ldots,n}$, and an integer sequence of length $m$ ($m \ge 2$), denoted as $b_{1,2,\ldots,m}$, we can construct an $n \times m$ matrix $c$ such that $c_{i,j} = a_i \oplus b_j$ ($1 \le i \le n, 1 \le j \le m$), where $\oplus$ denotes the bitwise XOR operation.
Determine how many pairs $(i, j)$ ($1 \le i < n, 1 \le j < m$) satisfy that the subrectangle region of $c$ given by $\begin{bmatrix} c_{i,j} & c_{i,j+1} \\ c_{i+1,j} & c_{i+1,j+1} \end{bmatrix}$ is of the form $\begin{bmatrix} x & x + 1 \\ x + 2 & x + 3 \end{bmatrix}$, meaning that $c_{i,j+1} = c_{i,j} + 1$, $c_{i+1,j} = c_{i,j} + 2$, and $c_{i+1,j+1} = c_{i,j} + 3$.
Input
The first line contains an integer $T$ ($1 \le T \le 10^5$), representing the number of test cases.
For each test case:
The first line contains two space-separated integers $n, m$ ($2 \le n, m \le 2 \times 10^5$), representing the number of rows and columns of $c$.
The second line contains $n$ space-separated integers, representing $a_1, a_2, \ldots, a_n$ ($0 \le a_i < 2^{30}$).
The third line contains $m$ space-separated integers, representing $b_1, b_2, \ldots, b_m$ ($0 \le b_i < 2^{30}$).
It is guaranteed that the sum of $n$ does not exceed $2 \times 10^5$ and the sum of $m$ does not exceed $2 \times 10^5$.
Output
For each test case, output a single line containing an integer, representing how many pairs $(i, j)$ satisfy the condition.
Examples
Input 1
5 2 2 0 2 0 1 3 3 6 4 2 6 7 10 5 4 4 6 5 1 3 1 0 2 3 7 2 7 3 1 4 0 0 1 6 5 5 5 1 7 5 3 1 3 2 7 7 6
Output 1
1 2 1 0 6