|
||||||||||
ExpectationTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 147 Accepted Submission(s): 83 Problem Description Notice£ºDon't output extra spaces at the end of one line. There are $(2n+1)$ distinct positions on the number line, $x_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 $n$ 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 $998244353$ Input First line contains an integer $T(1\leq T\leq 2000)$, number of test cases. In each test cases, the first line contains an integer $n(1\leq n\leq 3000)$. The second line contains $(2n+1)$ integers in a single line representing $x_1,x_2,...x_{2n+1}$ $-10^9\leq x_1<x_2,...,<x_{2n+1}\leq 10^9$ Output $T$ lines, each with a non-negative integer representing the answer. Sample Input
Sample Output
Source | ||||||||||
|