Hamming Distance

Read two n-dimensional integer vectors and count the positions where their entries differ.

Easy1ImplementationArrayInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

The Hamming distance dH(v,u)d_H(\vec{v}, \vec{u}) between two nn-dimensional vectors v=(v1,,vn)\vec{v} = (v_1, \ldots, v_n) and u=(u1,,un)\vec{u} = (u_1, \ldots, u_n) is the number of positions at which the corresponding entries differ.

dH(v,u)={i:viui,  i{1,,n}}d_H(\vec{v}, \vec{u}) = |\{\, i : v_i \neq u_i,\; i \in \{1, \ldots, n\} \,\}|

For example, the Hamming distance between (1,2,3,4,5)(1, 2, 3, 4, 5) and (1,0,0,4,5)(1, 0, 0, 4, 5) is 22. The two vectors differ only at the second position and the third position.

Write a program that computes the Hamming distance between two nn-dimensional vectors.

Input

The first line contains the number of test cases TT. (T100T \le 100)

Each test case consists of three lines. The first line contains the dimension nn of the vectors. (0<n500 < n \le 50) The second line contains v1,,vnv_1, \ldots, v_n and the third line contains u1,,unu_1, \ldots, u_n, separated by spaces. Every entry is an integer between 00 and 9999, inclusive.

Output

For each test case, print the Hamming distance between (v1,,vn)(v_1, \ldots, v_n) and (u1,,un)(u_1, \ldots, u_n), one per line.