AtCoder Regular Contest 178
E
Serval Survival
AtCoder
未评级
原题
← DF →
翻译中…

Problem Statement

翻译中…

There are $N$ servals on a bridge of length $L$.

翻译中…

The $i$-th serval is located at position $A_{i}$ from the left end of the bridge.

翻译中…

Here, $0 < A_{1} < A_{2} < \cdots < A_{N} < L$ holds.

翻译中…

For each $i = 1, 2, \dots, N$, answer the following question:

翻译中…

The servals will perform the following three actions in order:

  • Action $1$: The $N - 1$ servals other than the $i$-th serval face left or right.
  • Action $2$: The $i$-th serval faces left or right.
  • 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.

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.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^{5}$
  • $0 < A_{1} < A_{2} < \cdots < A_{N} < L \leq 10^{9}$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N L
A_{1} A_{2} \cdots A_{N}

翻译中…

Output

翻译中…

Print $N$ lines. The $k$-th line should contain the answer for $i=k$.

翻译中…

样例

Input #1
2 167
9 24
Output #1
182
301
For $i = 1$, it is always optimal to face right. For $i = 2$, it is optimal to face the opposite direction from the first serval.
Input #2
1 924
167
Output #2
757
Input #3
10 924924167
46001560 235529797 272749755 301863061 359726177 470023587 667800476 696193062 741860924 809211293
Output #3
112048251
409175578
167800512
997730745
278651538
581491882
884751575
570877705
747965896
80750577
题目信息
题号
arc178_e
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。