Busy Beaver and Sneaky Snake visit a carrot shop. There are $$$N$$$ carrots for sale, arranged in a row from left to right. The carrots are numbered $$$1, 2, \dots, N$$$ from left to right, and the $$$i$$$-th carrot has a flavor index $$$a_i$$$.
They want to eat carrots to maximize their total satisfaction. They take turns eating carrots, with Busy Beaver going first.
When a player eats a carrot, they gain satisfaction equal to that carrot's flavor index. The game ends when all carrots have been eaten.
Both players play optimally to maximize their own total satisfaction. Before they start, Busy Beaver wants to know the final total satisfactions of Busy Beaver and Sneaky Snake.
Furthermore, the shop owner frequently changes the flavor index of a carrot. There are $$$Q$$$ modifications; in each modification, the flavor index of one carrot is changed. After each modification, compute the final total satisfactions of both players. Note that the modifications are applied cumulatively.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$) — the number of test cases.
The first line of each test case contains two integers $$$N$$$ and $$$Q$$$ ($$$4 \le N \le 2 \cdot 10^5$$$, $$$0 \le Q \le 2 \cdot 10^5$$$).
The second line of each test case contains $$$N$$$ integers $$$a_1, a_2, \dots, a_N$$$, where $$$a_i$$$ is the initial flavor index of the $$$i$$$-th carrot ($$$1 \le a_i \le 10^9$$$).
Each of the next $$$Q$$$ lines contains two integers $$$x_i$$$ and $$$v_i$$$, meaning that in the $$$i$$$-th modification, the flavor index of the $$$x_i$$$-th carrot is changed to $$$v_i$$$ ($$$1 \le x_i \le N$$$, $$$1 \le v_i \le 10^9$$$).
The sum of $$$N$$$ across all test cases does not exceed $$$2 \cdot 10^5$$$.
The sum of $$$Q$$$ across all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output $$$Q+1$$$ lines.
On the first line, output the final total satisfactions of Busy Beaver and Sneaky Snake respectively for the initial flavor indices.
On the next $$$Q$$$ lines, in the $$$i$$$-th line, output the final total satisfactions after applying the first $$$i$$$ modifications.
There are three subtasks for this problem.
44 03 5 1 64 62 7 4 12 51 63 92 24 113 19 04 2 3 7 5 1 6 9 88 54 3 6 5 10 1 2 72 85 46 93 32 15
8 79 57 511 511 108 1015 138 1220 2518 2023 2023 1423 2220 2227 22
In the first test case, the initial flavor indices are $$$A = [3, 5, 1, 6]$$$. The game will proceed as follows.
At the end of the game, Busy Beaver has total satisfaction $$$8$$$, and Sneaky Snake has total satisfaction $$$7$$$.