#P7837. Expectation

Expectation

Expectation

Problem Description

Notice:Don't output extra spaces at the end of one line. There are (2n+1)(2n+1) distinct positions on the number line, x1,x2,....x2n+1x_1,x_2,....x_{2n+1} in the strictly increasing order. each position with odd index is a hole and each postition with even index is a ball. Koishi will play a game consisting of nn rounds, in each round: 1.Koishi selects a ball that isn't in holes at random. 2.then select the direction,left or right at random. 3.then the chosen ball starts rolling in that chosen direction, until it falls into an empty hole(the hole with no ball falling into it before) Koishi is interested in the sum of distances of balls rolling. What is the expected value of the sum? modulo 998244353998244353

Input

First line contains an integer T(1T2000)T(1\leq T\leq 2000), number of test cases. In each test cases, the first line contains an integer n(1n3000)n(1\leq n\leq 3000). The second line contains (2n+1)(2n+1) integers in a single line representing x1,x2,...x2n+1x_1,x_2,...x_{2n+1} 109x1<x2,...,<x2n+1109-10^9\leq x_1<x_2,...,<x_{2n+1}\leq 10^9

Output

TT lines, each with a non-negative integer representing the answer.

Sample Input

3
1
1 2 3
3
1 2 3 4 5 6 7
10
0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 210

Sample Output

1
332748122
969129126

Source

2020 Multi-University Training Contest 7