No.3621 Find Schröder Coordinate in Nonresonant Case
Note
The time limit for this problem is $10$ seconds.
Problem Statement
You are given an integer $n$ greater than or equal to $3$.
You are given a formal power series $f(x)\coloneqq \sum_{i=0}^{n-1}a_i x^i\in \mathbb{F}_{998244353}[[x]]$. The constraints guarantee that these satisfy the following properties.
- $a_0=0$
- $a_1^i \not\equiv a_1 \pmod {998244353}\ (i=2,3,\dots, n-1)$
Find $g(x)\coloneqq \sum_{i=0}^{n-1}b_i x^i \in\mathbb{F}_{998244353}[[x]]$ and $h(x)\coloneqq g^{\langle -1\rangle}(x) \bmod x^n=\sum_{i=0}^{n-1}c_i x^i \in\mathbb{F}_{998244353}[[x]]$ satisfying the following conditions.
- $b_0=0$
- $b_1=1$
- $g(f(x)) \equiv a_1 g(x)\pmod {x^{n}}$
- $g(h(x)) \equiv h(g(x)) \equiv x\pmod {x^{n}}$
It can be proved that such $g(x),h(x)$ are uniquely determined.
Constraints
- All input values are integers
- $3\le n\le 200000$
- $0\le a_i\lt 998244353$
- $a_0=0$
- $a_1^i \not\equiv a_1 \pmod {998244353}\ (i=2,3,\dots, n-1)$
Input
$n$
$a_0$ $a_1$ $\dots$ $a_{n-1}$
Output
Output in the following format, where $b_i,c_i$ are integers satisfying $0\le b_i,c_i\lt 998244353$.
$b_0$ $b_1$ $\dots$ $b_{n-1}$
$c_0$ $c_1$ $\dots$ $c_{n-1}$
Sample
Sample 1
Input
4 0 2 0 1
Output
0 1 0 831870294 0 1 0 166374059
Sample 2
Input
10 0 2 97460621 111410723 910781021 787650035 525397272 778634186 769261814 17908181
Output
0 1 450391866 851628676 116766808 102424189 629373870 830133384 438172635 610210161 0 1 547852487 703228107 427427877 24030916 160333921 387872980 756810038 143082494
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noya2