You have $$$N$$$ Arcane Behemoths, each with an attack value $$$A_i$$$.
You may choose any non-empty subsequence of Behemoths and sell them one by one. Whenever you sell a Behemoth, each remaining unsold Behemoth in the subsequence increases its attack value by the attack value of the Behemoth you just sold.
The value of a subsequence is the maximum attack value the last remaining Behemoth can achieve, if the other Behemoths in the subsequence are sold in an optimal order.
Your task is to compute the sum of values over all non-empty subsequences of the sequence. Print the result modulo $$$998244353$$$.
The first line contains a single integer $$$T$$$ ($$$1 \leq T \leq 2 \times 10^5$$$) — the number of test cases.
For each test case, the first line contains an integer $$$N$$$ ($$$1 \leq N \leq 2 \times 10^5$$$) — the number of Behemoths.
The second line contains $$$N$$$ integers $$$A_1, A_2, \ldots, A_N$$$ $$$(0 \leq A_i \lt 998244353)$$$ — the initial attack values of the Behemoths.
It is guaranteed that $$$\sum N \leq 2\times 10^5$$$ over all test cases.
For each test case, print a single integer — the sum of values over all non-empty subsequences modulo $$$998244353$$$.
331 2 361 1 4 5 1 43998244350 998244351 998244352
27 1266 998244328
Consider the subsequences of $$$[1,2,3]$$$:
Finally, summing all values: $$$1+2+3+3+4+5+9 = 27$$$.
| Название |
|---|


