Japanese Knowledge

아직 제출이 없습니다시간 제한10초메모리 제한512 MB

문제

This problem might be well-known in some countries, but how do other countries learn about such problems if nobody poses them?

You are given a non-decreasing positive integer sequence A=(A_1,A_2,,A_N)A = (A\_1, A\_2, \ldots, A\_N) of length NN. For each k=0,1,2,,Nk=0,1,2,\ldots,N, count the number of non-decreasing non-negative integer sequences x=(x_1,x_2,,x_N)x = (x\_1, x\_2, \ldots, x\_N) of length NN that satisfy following conditions, modulo 998244353998244353:

  • x_iA_ix\_i \leq A\_i for all 1iN1 \leq i \leq N.
  • The number of indices ii with x_i=A_ix\_i=A\_i is exactly kk.

입력

The first line contains an integer NN (1N2500001 \leq N \leq 250000).

The second line contains NN integers A_1,A_2,,A_NA\_1,A\_2,\ldots,A\_N (1A_1A_2A_N2500001 \leq A\_1 \leq A\_2 \leq \cdots \leq A\_N \leq 250000).

출력

For each k=0,1,2,,Nk=0,1,2,\ldots,N, print the answer.