#P1910E. Maximum Sum Subarrays

Maximum Sum Subarrays

Description

You are given two integer arrays aa and bb, both of length nn.

You can perform the following operation any number of times (possibly zero): swap aia_i and bib_i.

Let f(c)f(c) be the maximum sum of a contiguous subarray of the array cc (including the empty subsegment, which sum is 00).

Your task is to calculate the maximum possible value of f(a)+f(b)f(a) + f(b), using the aforementioned operation any number of times.

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The first line of each test case contains a single integer nn (1n21051 \le n \le 2 \cdot 10^5).

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

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

The sum of nn over all test case doesn't exceed 21052 \cdot 10^5.

For each test case, print a single integer — the maximum possible value of f(a)+f(b)f(a) + f(b), using the aforementioned operation any number of times.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The first line of each test case contains a single integer nn (1n21051 \le n \le 2 \cdot 10^5).

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

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

The sum of nn over all test case doesn't exceed 21052 \cdot 10^5.

Output

For each test case, print a single integer — the maximum possible value of f(a)+f(b)f(a) + f(b), using the aforementioned operation any number of times.

Sample Input 1

3
3
2 -1 3
-4 0 1
6
4 2 -6 1 6 -4
-6 -2 -3 7 -3 2
2
-2 -5
0 -1

Sample Output 1

6
21
0