
ZOJ Problem Set  3970
Chiaki has a sequence s_{1}, s_{2}, ..., s_{n}. She would like to change it to another sequence t_{1}, t_{2}, ..., t_{n} using the following operations:
Chiaki would like to know the minimum number of operations needed. InputThere are multiple test cases. The first line of input contains an integer T, indicating the number of test cases. For each test case: The first line contains an integer n (1 ≤ n ≤ 10^{5}) — the length of the sequence. The second line contains n integers s_{1}, s_{2}, ..., s_{n} (0 ≤ s_{i} ≤ 10^{9}). The third line contains n integers t_{1}, t_{2}, ..., t_{n} (0 ≤ t_{i} ≤ 10^{9}). It is guaranteed that the sum of n over all test cases does not exceed 10^{6}. OutputFor each test case, output an integer denoting the minimum number of operations. If it is impossible to change the sequence, output 1 instead. Sample Input2 5 1 1 1 1 1 2 0 2 0 2 7 3 1 2 3 2 1 4 2 0 0 0 0 0 2 Sample Output3 3 HintFor the first test case: Author: LIN, Xi Source: The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple 