QOJ.ac

QOJ

حد الوقت: 1.5 s حد الذاكرة: 1024 MB مجموع النقاط: 100 قابلة للهجوم ✓

#620. Polynomial Logarithm

الإحصائيات

Given a polynomial $A(z)=\sum^{n-1}_{i=0} a_ix^i$, compute $\ln A(z) \bmod {x^n} = \sum^{n-1}_{i=0} c_iz^n$.

Input

The first line contains an integer $n$.

The next line contains $n$ integers $a_0, a_1, \dots, a_{n-1}$. It is guaranteed that $a_0=1$.

Output

Output a single line containing $n$ integers, representing $c_0, c_1, \dots, c_{n-1}$, modulo 998244353.

Examples

Input 1

6 
1 2 3 4 5 6

Output 1

0 2 1 665496236 499122177 199648871

Subtasks

For all data, $1 \leq n \leq 10^6$, $0 \le a_i < 998\,244\,353$, and $a_0 = 1$.

Subtask $n \le$ Score
1 100 10
2 $5 \cdot 10^3$ 10
3 $3 \cdot 10^4$ 10
4 $10^5$ 10
5 $1.5 \cdot 10^5$ 10
6 $2 \cdot 10^5$ 10
7 $3 \cdot 10^5$ 10
8 $5 \cdot 10^5$ 10
9 $7 \cdot 10^5$ 10
10 $10^6$ 10

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.