G. Update the Sequence
time limit per test
6 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given two sequences $$$a_0,a_1,\dots,a_{n-1}$$$ and $$$b_0,b_1,\dots,b_{n-1}$$$, you are required to perform $$$q$$$ operations. For each operation, you will be given an integer $$$k$$$ ($$$0\leq k \lt n$$$), you need to update $$$a_i$$$ into $$$\max(a_i,b_{(i+k)\bmod n})$$$ for each $$$i$$$ ($$$0\leq i \lt n$$$). To prove that you do perform these operations, output the value of $$$\sum_{i=0}^{n-1} a_i$$$ after each operation.

Input

The first line contains a single integer $$$T$$$ ($$$1 \leq T \leq 2$$$), the number of test cases. For each test case:

The first line contains two integers $$$n$$$ and $$$q$$$ ($$$1\leq n,q\leq 250\,000$$$), denoting the length of the sequence and the number of operations.

The second line contains $$$n$$$ positive integers $$$a_0,a_1,\dots,a_{n-1}$$$ ($$$1\leq a_i\leq 10^9$$$).

The third line contains $$$n$$$ positive integers $$$b_0,b_1,\dots,b_{n-1}$$$ ($$$1\leq b_i\leq 10^9$$$).

Each of the next $$$q$$$ lines contains a single integer $$$k$$$ ($$$0\leq k \lt n$$$), describing each operation.

It is guaranteed that all the values of $$$a_i$$$, $$$b_i$$$ are chosen uniformly at random from integers in $$$[1,10^9]$$$, and each $$$k$$$ is chosen uniformly at random from integers in $$$[0,n)$$$. The randomness condition does not apply to the sample test case, but your solution must pass the sample as well.

Output

For each test case, output $$$q$$$ lines, the $$$i$$$-th ($$$1\leq i\leq q$$$) of which containing an integer, denoting the value of $$$\sum_{i=0}^{n-1} a_i$$$ after the $$$i$$$-th operation is applied.

Example
Input
1
5 5
1 5 3 6 8
2 5 4 7 3
3
2
4
1
0
Output
29
31
33
35
36