{"raw_statement":[{"iden":"problem statement","content":"There are $N$ servals on a bridge of length $L$.\nThe $i$\\-th serval is located at position $A_{i}$ from the left end of the bridge.\nHere, $0 < A_{1} < A_{2} < \\cdots < A_{N} < L$ holds.\nFor each $i = 1, 2, \\dots, N$, answer the following question:\n\n> The servals will perform the following three actions in order:\n> \n> *   Action $1$: The $N - 1$ servals other than the $i$\\-th serval face left or right.\n> *   Action $2$: The $i$\\-th serval faces left or right.\n> *   Action $3$: All servals start moving simultaneously. All servals move at a constant speed of exactly $1$ unit distance per unit time. When a serval reaches the end of the bridge, it leaves the bridge. If two servals collide, they both reverse their direction and continue moving.\n> \n> The $i$\\-th serval is smart and loves this bridge, so when choosing a direction in Action $2$, it will observe the directions of the other $N-1$ servals and choose the direction that allows it to stay on the bridge the longer during Action $3$. There are $2^{N-1}$ possible combinations of directions for the $N-1$ servals in Action $1$. Find the sum, modulo $998244353$, over all these combinations, of the durations the $i$\\-th serval can stay on the bridge. It can be proved that the output value is an integer."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{5}$\n*   $0 < A_{1} < A_{2} < \\cdots < A_{N} < L \\leq 10^{9}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $L$\n$A_{1}$ $A_{2}$ $\\cdots$ $A_{N}$"},{"iden":"sample input 1","content":"2 167\n9 24"},{"iden":"sample output 1","content":"182\n301\n\nFor $i = 1$, it is always optimal to face right.\nFor $i = 2$, it is optimal to face the opposite direction from the first serval."},{"iden":"sample input 2","content":"1 924\n167"},{"iden":"sample output 2","content":"757"},{"iden":"sample input 3","content":"10 924924167\n46001560 235529797 272749755 301863061 359726177 470023587 667800476 696193062 741860924 809211293"},{"iden":"sample output 3","content":"112048251\n409175578\n167800512\n997730745\n278651538\n581491882\n884751575\n570877705\n747965896\n80750577"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}