A. Maximum Distance

Time limit: 1s Memory limit: 256MB Input: Output:

Before giving you the problem statement, we will define dist([x1,x2,xk],[y1,y2,yk])dist([x_1, x_2, \dots x_k], [y_1, y_2, \dots y_k]) as the number of indexes ii (1ik1 \leq i \leq k) such that xiyix_i \neq y_i.

Task

You are given nn and two arrays a1,a2,ana_1, a_2, \dots a_n and b1,b2,bnb_1, b_2, \dots b_n. Find the maximum distdist when choosing any two subarrays of your choice (one from aa and one from bb) that have the same length.
A subarray of cc is a contiguous part of an array cc, i. e. the array ci,ci+1,cjc_i, c_{i+1}, \dots c_j for some 1ijn1 \leq i \leq j \leq n.

Input

The first line contains an integer tt (1t1041 \leq t \leq 10^4) the number of test cases. Then follows the description of the test cases.

The first line of each test case contains an integer nn (1n10 0001 \leq n \leq 10 \ 000).

The second line of each test case contains nn integers a1,a2,ana_1, a_2, \dots a_n (109ai109-10^9 \leq a_i \leq 10^9).

The third line of each test case contains nn integers b1,b2,bnb_1, b_2, \dots b_n (109bi109-10^9 \leq b_i \leq 10^9).

It is guaranteed that the sum of nn over all test cases is at most 10 00010 \ 000.

Output

For each test case, print a single integer - the maximum distdist of two subarrays of equal length, one from array aa and the other on from array bb.

Examples

stdin

7
6
-1 -4 2 -5 -2 10
4 4 -8 2 -4 -8
4
6 2 3 4
2 6 7 4
6
4 -7 -3 10 6 5
4 4 4 4 6 4
6
-4 2 -10 -2 -9 10
-4 -4 2 -2 -9 10
6
12 7 -7 -6 -9 -7
-9 12 -7 12 -9 12
4
1 2 3 4
5 6 7 4
4
1 2 3 4
1 2 3 5

stdout

6
3
5
5
5
3
3

Log in or sign up to be able to send submissions!