Question

Streaks

2

3

3 1 2

2 4 1

2

0 0

10 10

3

0

The most popular feature on snapchat is * Snapchat Streak*. A streak is maintained between two people if

**both**of them send

**at least one**snap to each other

**daily**.

If, on any day, either person forgets to send at least one snap, the streak breaks and the streak count is set to 0. Raj and Rita like maintaining their snapchat streak. You observed the snap count of both of them for N consecutive days. On the i

^{th}day, Raj sent A

_{i }snaps to Rita while Rita sent B

_{i} snaps to Raj.

Find the

**maximum**streak count they achieved in those N days.

Input

The first line of input will contain a single integer T, denoting the number of test cases.

Each test case consists of multiple lines of input.

The first line of each test case contains an integer N - the number of days you observed.

The second lines contains N space-separated integers - A

The third lines contains N space-separated integers - B

1 ≤ T ≤ 100

1 ≤ N ≤ 1000

0 ≤ A

Each test case consists of multiple lines of input.

The first line of each test case contains an integer N - the number of days you observed.

The second lines contains N space-separated integers - A

_{1}, A_{2}..., A_{N}the number of snaps Raj sent to Rita on the i^{th}day.The third lines contains N space-separated integers - B

_{1}, B_{2}..., B_{N}, the number of snaps Rita sent to Raj on the i^{th}day.**Constraints**1 ≤ T ≤ 100

1 ≤ N ≤ 1000

0 ≤ A

_{i}, B_{i}≤ 100Output

For each test case, output on a new line, the maximum streak count they achieved in those N days.

Example

**Sample Input**

2

3

3 1 2

2 4 1

2

0 0

10 10

**Sample Output**

3

0

**Explanation**

**Test case 1**: For all 3 days, both Raj and Rita sent at least one snap per day. Thus, at the end of third day, the streak count is 3.

**Test case 2**: Raj did not send any snap to Rita. Thus, at the streak count remains 0 on both days.