시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB888100.000%

문제

Alice and Bob like playing games. Today they play on a special grid with $2$ rows and $n$ columns. Alice and Bob each have a chess piece, starting at $(1,1)$ and $(2,n)$, respectively. They will take turns moving their chess piece, with Alice going first.

In each turn, they can choose to stay still or move the chess piece to any point adjacent horizontally or vertically which has not been visited by the other's piece. The game will end after $10^{10^{10}}$ turns.

Every point in this grid has a non-negative weight. For each player, the score that he/she gets is the sum of the weights of all the points his/her chess piece has visited. The weight is counted only once, even if the piece visited a point multiple times.

Both Alice and Bob want to maximize the score that they get. As a spectator, you want to know the score that Alice gets if both of them play optimally.

입력

The first line contains an integer $t$, the number of test cases ($1 \le t \le 5 \cdot 10^4$). The test cases follow.

The first line of each test case contains a single integer $n$ representing the size of the grid ($1 \le n \le 10^5$).

The second line of each test case contains $n$ integers $a_{1,1},a_{1,2},\ldots,a_{1,n}$. The $i$-th of them represents the weight of point $(1,i)$.

The third line of each test case contains $n$ integers $a_{2,1},a_{2,2},\ldots,a_{2,n}$. The $i$-th of them represents the weight of point $(2,i)$.

It is guaranteed that $0 \le a_{i,j} \le 10^9$, and the sum of $n$ across all test cases will not exceed $2.5 \cdot 10^5$.

출력

For each test case, print a line with a single integer: the score that Alice gets if both players play optimally.

예제 입력 1

4
2
1 4
2 1
3
1 1 4
5 1 4
4
1 9 4 9
1 0 0 1
7
3 1 4 1 5 9 2
6 5 3 5 8 9 8

예제 출력 1

5
6
15
25