Niko is playing a game. Her score is denoted by an integer $k$ which is $0$ initially.
The game has $n$ turns. On the $i$-th turn, Niko is given a red card with an integer $a_i$ on it, as well as a blue card with an integer $b_i$ on it. She must choose exactly one of the cards and update her score according to her choice:
- If she chooses the red card, her score becomes
$k - a_i$, where$k$is her score before the turn. - If she chooses the blue card, her score becomes
$b_i - k$, where$k$is her score before the turn.
After this, the game proceeds to the next turn, or ends if it is the $n$-th turn.
Your task is to find the maximum possible score Niko can obtain at the end of the game.
Input
Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^3$). The description of the test cases follows.
The first line of each test case contains a single integer $n$ ($1 \le n \le 10^5$) — the number of turns.
The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($-10^9 \le a_i \le 10^9$).
The third line of each test case contains $n$ integers $b_1, b_2, \ldots, b_n$ ($-10^9 \le b_i \le 10^9$).
It is guaranteed that the sum of $n$ over all test cases does not exceed $10^5$.
Output
For each test case, output a single integer — the maximum possible score Niko can obtain at the end of the game.
Note
In the first test case, one optimal strategy is as follows:
Turn0123Card Chosen—BlueRedRedScore$0$$-3 - 0 = -3$$-3 - (-8) = 5$$5 - (-1) = 6$
In the second test case, one optimal strategy is as follows:
Turn012345Card Chosen—BlueBlueBlueBlueRedScore$0$$-5$$8$$-9$$13$$12$
样例
3
3
4 -8 -1
-3 -7 0
5
-3 1 0 7 1
-5 3 -1 4 -5
5
-7 7 5 4 9
-9 -3 3 2 2
6
12
27
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。